dnsfilter_uninstall.ps1 - limehawk/rmm-scripts GitHub Wiki
dnsfilter_uninstall.ps1
Completely removes DNSFilter agent from a Windows system.
Overview
Completely removes DNSFilter agent from a Windows system including:
- Uninstalling the MSI package
- Stopping and removing services
- Deleting installation folders
- Cleaning up registry keys
- Resetting DNS settings to DHCP
- Flushing DNS cache
Purpose
Completely removes DNSFilter agent from a Windows system including:
- Uninstalling the MSI package
- Stopping and removing services
- Deleting installation folders
- Cleaning up registry keys
- Resetting DNS settings to DHCP
- Flushing DNS cache
Prerequisites
- Windows 10/11 or Windows Server
- Administrator privileges
Configuration
Required Inputs
None
Behavior
- Uninstalls DNS Agent via WMI if installed
- Stops and deletes related Windows services
- Removes installation folders
- Cleans up registry keys
- Resets all NICs to use DHCP for DNS
- Flushes DNS cache
Security Notes
- No secrets in logs
- Requires elevated privileges
- Resets DNS to DHCP (may affect connectivity)
Exit Codes
- 0 = Success
- 1 = Failure
Example Output
[ UNINSTALLING DNS AGENT ]
--------------------------------------------------------------
DNS Agent : Found
Uninstall : SUCCESS
[ REMOVING SERVICES ]
--------------------------------------------------------------
DNS Agent : Stopped and deleted
DNSFilter Agent : Not found (skipped)
[ REMOVING FOLDERS ]
--------------------------------------------------------------
C:\Program Files\DNS Agent : Removed
[ CLEANING REGISTRY ]
--------------------------------------------------------------
HKLM:\SOFTWARE\DNSAgent : Removed
[ RESETTING DNS ]
--------------------------------------------------------------
Ethernet : Reset to DHCP
Wi-Fi : Reset to DHCP
DNS Cache : Flushed
[ FINAL STATUS ]
--------------------------------------------------------------
SCRIPT SUCCEEDED
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
Version History
- 2024-12-01 v1.0.0 - Initial release - migrated from SuperOps
Links
- View Script Source
- Scripts - Back to script index