Skip to content

dnsfilter_uninstall.ps1

Corey Watson edited this page Dec 19, 2025 · 1 revision

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

  1. Uninstalls DNS Agent via WMI if installed
  2. Stops and deletes related Windows services
  3. Removes installation folders
  4. Cleans up registry keys
  5. Resets all NICs to use DHCP for DNS
  6. 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

Clone this wiki locally