Bob | PTI B.V. Posted August 10, 2020 Posted August 10, 2020 Hi all, Do anyone of you have a script to remove Solarwinds products? In our case, that should be the N-able Windows agent and Solarwinds MSP (SolarWinds MSP Cache Service, SolarWinds MSP Patch Management Engine, SolarWinds MSP RPC Server). Or have any experience removing it using automation? Thanks in advance! Â
AC_Martin_J Posted August 11, 2020 Posted August 11, 2020 Maybe this is helpful.. I ran this script in Pulseway to remove Solarwinds N-Central RMM a while back. It won't uninstall all the software solutions you mention, but it might put you one step closer if you replace some of the code with updated uninstall strings etc.  $installstate = Get-Item -path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{940B905A-92ED-4646-B38B-321F80873C37}' -ErrorAction SilentlyContinue if ($installstate -eq $null) {   Write-Host 'N-Central Uninstall Registry, was not found and might already be removed.'   exit } else {   Write-Host 'Uninstalling Ncentral RMM Agent'   Start-Process MsiExec.exe '/X{940B905A-92ED-4646-B38B-321F80873C37} /qn'   Start-Sleep -s 30   $program = 'Windows Agent'   $program2 = 'Ncentral RMM Agent'   Write-Host 'Verifying uninstallation...'     $32bit = ((Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall") |       Where-Object { $_.GetValue( "DisplayName" ) -like "*$program*" } ).Length -gt 0;     $64bit = ((Get-ChildItem "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall") |      Where-Object { $_.GetValue( "DisplayName" ) -like "*$program*" } ).Length -gt 0;     if ($32bit -eq $False -and $64bit -eq $False)    {      Write-Host "$program2 were uninstalled successfully."    }       Write-Host 'Deleting N-Central registry keys...'   $Reg1 = Test-Path 'HKLM:\SOFTWARE\N-able Technologies'   if ($Reg1 -eq $True)   {   Remove-Item 'HKLM:\SOFTWARE\N-able Technologies' -Recurse   $Reg1v = Test-Path 'HKLM:\SOFTWARE\N-able Technologies'   Write-Host 'Registry key 1 still present?' $Reg1v   }   else   {   Write-Host 'Registry key 1 did not exist and will be ignored.'   }   $Reg2 = Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\N-able Technologies Inc. Windows Agent'   if ($Reg2 -eq $True)   {   Remove-Item 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\N-able Technologies Inc. Windows Agent' -Recurse   $Reg2v = Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\N-able Technologies Inc. Windows Agent'   Write-Host 'Registry key 2 still present?' $Reg2v   }   else   {   Write-Host 'Registry key 2 did not exist and will be ignored.'   }   $Reg3 = Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent'   if ($Reg3 -eq $True)   {   Remove-Item 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent' -Recurse   $Reg3v = Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent'   Write-Host 'Registry key 3 still present?' $Reg3v   }   else   {   Write-Host 'Registry key 3 did not exist and will be ignored.'   }   $Reg4 = Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent Maintenance'   if ($Reg4 -eq $True)   {   Remove-Item 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent Maintenance' -Recurse   $Reg4v = Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\N-able Technologies Windows Agent Maintenance'   Write-Host 'Registry key 4 still present?' $Reg4v   }   else   {   Write-Host 'Registry key 4 did not exist and will be ignored.'   } } start-sleep s 30 Remove-Item "C:\Program Files (x86)\N-able Technologies" -recurse $installstate2 = Get-Item -path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{940B905A-92ED-4646-B38B-321F80873C37}' -ErrorAction SilentlyContinue if ($installstate2 -eq $null) {   Write-Host "$program2 was successfully uninstalled."   exit }
Bob | PTI B.V. Posted August 11, 2020 Author Posted August 11, 2020 Hi Martin, Thanks for you're help, I'll be testing this to see what will happen and adjust where I need to. Although I'm not that good at scripting, this seems to be not that hard, I hope... Keep you posted!
eDecisions Posted August 15, 2020 Posted August 15, 2020 I did this for NINJA, try playing with the search key where the -match "your program" but be carefull  $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString sleep -seconds 2 if (!$UninstallString) { exit } sleep -seconds 2 $path = $UninstallString -replace "uninstall.exe", "" sleep -seconds 5 cd $path sleep -seconds 5 Start-Process -FilePath .\uninstall.exe -ArgumentList "--mode","unattended" sleep -seconds 40 $Uninstall2 = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match "NinjaRMMAgent" } | Select-Object -Property UninstallString | foreach { $_.UninstallString } sleep -seconds 220 $Uninstall3 = $Uninstall2 -Replace "MsiExec.exe " , "" sleep -seconds 5 Start-Process -FilePath MSIExec.exe -ArgumentList $Uninstall3,"/quiet","/passive"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now