PowerShell Script to Force Uninstall Umbrella Roaming Client
Uninstalling the Umbrella Roaming Client can be challenging, especially if traditional removal methods fail. Below is a PowerShell script designed to force the uninstallation, stopping related services, performing uninstall attempts, and resetting DNS settings. This script ensures a complete removal, even if previous uninstall methods fail.
Note: You must run the script with administrative\system privileges.
PowerShell Script
Copy the entire script below to execute it in PowerShell:
# PatrickDomingues.com
# Zevonix.com
# PowerShell Script to Force Uninstall Umbrella Roaming Client
# Ensure the script is running with administrative privileges
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Error "This script requires administrative privileges. Please run as Administrator."
exit
}
# Stop the Umbrella_RC service
Write-Host "Stopping the Umbrella_RC service..."
try {
Stop-Service -Name "Umbrella_RC" -Force -ErrorAction Stop
Write-Host "Service stopped successfully."
} catch {
Write-Warning "Failed to stop the Umbrella_RC service: $($_.Exception.Message)"
}
# Attempt uninstall via WMIC
Write-Host "Attempting to uninstall Umbrella Roaming Client using WMIC..."
try {
wmic Product where "name='Umbrella Roaming Client (x86)'" call uninstall > $null
Write-Host "Uninstallation using WMIC completed."
} catch {
Write-Warning "Failed to uninstall using WMIC: $($_.Exception.Message)"
}
# Attempt uninstall using MSI
$msiPath = "C:\Program Files (x86)\OpenDNS\Umbrella Roaming Client\" # Replace with the actual path to the setup MSI
if (Test-Path $msiPath) {
Write-Host "Attempting to uninstall Umbrella Roaming Client using MSI..."
try {
Start-Process msiexec.exe -ArgumentList "/x `"$msiPath`" /qn" -Wait -NoNewWindow
Write-Host "Uninstallation using MSI completed."
} catch {
Write-Warning "Failed to uninstall using MSI: $($_.Exception.Message)"
}
} else {
Write-Warning "MSI file not found at $msiPath. Skipping MSI uninstall step."
}
# Manual removal if previous steps fail
Write-Host "Performing manual removal of Umbrella Roaming Client..."
try {
# Delete the Umbrella_RC service
sc.exe delete "Umbrella_RC"
Write-Host "Service deleted successfully."
# Remove folders
$folders = @(
"C:\ProgramData\OpenDNS\ERC",
"C:\Program Files (x86)\OpenDNS"
)
foreach ($folder in $folders) {
if (Test-Path $folder) {
Remove-Item -Path $folder -Recurse -Force
Write-Host "Deleted folder: $folder"
} else {
Write-Host "Folder not found: $folder"
}
}
# Reset DNS settings
Write-Host "Resetting DNS settings to obtain automatically..."
$adapters = Get-NetAdapter -Physical | Where-Object { $_.Status -eq "Up" }
foreach ($adapter in $adapters) {
Write-Host "Resetting DNS for adapter: $($adapter.Name)"
Set-DnsClientServerAddress -InterfaceAlias $adapter.Name -ResetServerAddresses
}
Write-Host "DNS settings reset successfully."
} catch {
Write-Warning "An error occurred during manual removal: $($_.Exception.Message)"
}
Write-Host "Umbrella Roaming Client uninstallation completed."
Script Explanation
- Administrator Check:
The script verifies if it’s running with administrative privileges. If not, it halts execution and notifies the user. - Stopping the Service:
The script attempts to stop theUmbrella_RCservice, which may be preventing removal. - Uninstalling via WMIC:
It uses Windows Management Instrumentation Command-line (WMIC) to uninstall the Umbrella Roaming Client if it’s listed under installed programs. - MSI Uninstallation:
If WMIC fails, the script looks for the MSI installation path to trigger an uninstall viamsiexec. - Manual Removal:
If neither uninstall method succeeds, the script:- Deletes the
Umbrella_RCservice. - Removes relevant folders (
C:\ProgramData\OpenDNS\ERCandC:\Program Files (x86)\OpenDNS). - Resets DNS settings to automatic.
- Deletes the
- DNS Reset:
The script retrieves all active network adapters and resets their DNS settings to prevent any lingering DNS configuration issues.
Usage Tips
- Run this script with PowerShell as an administrator.
- Modify the
$msiPathvariable if your installation directory differs. - Ensure all other applications using the Umbrella Roaming Client are closed before running the script.
This comprehensive approach helps IT administrators forcefully uninstall the Umbrella Roaming Client when standard methods fail.
Discover more from Patrick Domingues
Subscribe to get the latest posts sent to your email.