Skip to content

Instantly share code, notes, and snippets.

@mark05e
Last active May 3, 2024 23:09
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save mark05e/708123de4c095ffb4f735c131d8cc783 to your computer and use it in GitHub Desktop.
Save mark05e/708123de4c095ffb4f735c131d8cc783 to your computer and use it in GitHub Desktop.
PowerShell script to forcefully remove Webroot SecureAnywhere. It is recommended to run the script twice, with a reboot after the first run.
# Removes Webroot SecureAnywhere by force
# Run the script once, reboot, then run again
# Webroot SecureAnywhere registry keys
$RegKeys = @(
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\WRData",
"HKLM:\SOFTWARE\WOW6432Node\WRCore",
"HKLM:\SOFTWARE\WOW6432Node\WRMIDData",
"HKLM:\SOFTWARE\WOW6432Node\webroot",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WRUNINST",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WRUNINST",
"HKLM:\SOFTWARE\WRData",
"HKLM:\SOFTWARE\WRMIDData",
"HKLM:\SOFTWARE\WRCore",
"HKLM:\SOFTWARE\webroot",
"HKLM:\SYSTEM\ControlSet001\services\WRSVC",
"HKLM:\SYSTEM\ControlSet001\services\WRkrn",
"HKLM:\SYSTEM\ControlSet001\services\WRBoot",
"HKLM:\SYSTEM\ControlSet001\services\WRCore",
"HKLM:\SYSTEM\ControlSet001\services\WRCoreService",
"HKLM:\SYSTEM\ControlSet001\services\wrUrlFlt",
"HKLM:\SYSTEM\ControlSet002\services\WRSVC",
"HKLM:\SYSTEM\ControlSet002\services\WRkrn",
"HKLM:\SYSTEM\ControlSet002\services\WRBoot",
"HKLM:\SYSTEM\ControlSet002\services\WRCore",
"HKLM:\SYSTEM\ControlSet002\services\WRCoreService",
"HKLM:\SYSTEM\ControlSet002\services\wrUrlFlt",
"HKLM:\SYSTEM\CurrentControlSet\services\WRSVC",
"HKLM:\SYSTEM\CurrentControlSet\services\WRkrn",
"HKLM:\SYSTEM\CurrentControlSet\services\WRBoot",
"HKLM:\SYSTEM\CurrentControlSet\services\WRCore",
"HKLM:\SYSTEM\CurrentControlSet\services\WRCoreService",
"HKLM:\SYSTEM\CurrentControlSet\services\wrUrlFlt"
)
# Webroot SecureAnywhere startup registry item paths
$RegStartupPaths = @(
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
)
# Webroot SecureAnywhere folders
$Folders = @(
"%ProgramData%\WRData",
"%ProgramData%\WRCore",
"%ProgramFiles%\Webroot",
"%ProgramFiles(x86)%\Webroot",
"%ProgramData%\Microsoft\Windows\Start Menu\Programs\Webroot SecureAnywhere"
)
# Try to Uninstall - https://community.webroot.com/webroot-secureanywhere-antivirus-12/pc-uninstallation-option-missing-from-control-panel-34688
Start-Process -FilePath "${Env:ProgramFiles(x86)}\Webroot\WRSA.exe" -ArgumentList "-uninstall" -Wait -ErrorAction SilentlyContinue
Start-Process -FilePath "${Env:ProgramFiles}\Webroot\WRSA.exe" -ArgumentList "-uninstall" -Wait -ErrorAction SilentlyContinue
# Stop & Delete Webroot SecureAnywhere service
sc.exe stop WRSVC
sc.exe stop WRCoreService
sc.exe stop WRSkyClient
sc.exe delete WRSVC
sc.exe delete WRCoreService
sc.exe delete WRSkyClient
# Stop Webroot SecureAnywhere process
Stop-Process -Name "WRSA" -Force
# Remove Webroot SecureAnywhere registry keys
ForEach ($RegKey in $RegKeys) {
Write-Host "Removing $RegKey"
Remove-Item -Path $RegKey -Force -Recurse -ErrorAction SilentlyContinue
}
# Remove Webroot SecureAnywhere registry startup items
ForEach ($RegStartupPath in $RegStartupPaths) {
Write-Host "Removing WRSVC from $RegStartupPath"
Remove-ItemProperty -Path $RegStartupPath -Name "WRSVC"
}
# Remove Webroot SecureAnywhere folders
ForEach ($Folder in $Folders) {
Write-Host "Removing $Folder"
Remove-Item -Path "$Folder" -Force -Recurse -ErrorAction SilentlyContinue
}
@Destruc69
Copy link

It must of been patched recently, I tried this last year and it worked just fine but now its patched as of trying it on my new school laptop

@mark05e
Copy link
Author

mark05e commented Apr 5, 2022

@Destruc69 Thank you for letting me know. Guess it might be outdated now.

@swtechpartners
Copy link

I just used your script to remove WR. It works well enough. It got me 90% of the way there. I had to manually delete a few WR services (WRCoreService and WRSkyClient) as well as the folder c:\program files\webroot. I was able to delete the folder in safe mode, boot back to normal mode, then use "sc delete wrcoreservice" and "sc delete wrskyclient" to clean up. On one computer I was able to use c:\program files\webroot\wrsc.exe -uninstall which seemed to be left over after I ran the ps1. This script is a great start and REALLY helpful, but full removal does seem to require a bit of manual intervention. I did try running the script in normal mode and safe mode, but it made no difference. Thank you for this!

@mark05e
Copy link
Author

mark05e commented Jul 30, 2022

Thank you for your feedback @swtechpartners

@Nels2
Copy link

Nels2 commented Oct 12, 2022

Has this project been abandoned?

@Nels2
Copy link

Nels2 commented Oct 12, 2022

Actually, without tweaking it does seem to do 90% of the job on Windows 8.1, Thank you sir.

@mark05e
Copy link
Author

mark05e commented Oct 12, 2022

@Nels2 feel free to add your changes. I no longer work with Webroot and cannot test the script out further.

@b1uey
Copy link

b1uey commented Oct 21, 2022

Any advice on how to get webroot removed via script that is reliable would be fantastic please, this method only works in safe mode

@mark05e
Copy link
Author

mark05e commented Oct 21, 2022

@b1uey - nothing that I know of.

@CKurti-MCMTSG
Copy link

CKurti-MCMTSG commented Oct 21, 2022

Any advice on how to get Webroot removed via script that is reliable would be fantastic please, this method only works in safe mode

I work for an MSP and I had to suffer through this recently...

Unfortunately if the Webroot Agent is Managed within Secure Anywhere Management Console, the policy has to be switched to Unmanaged or Deactivated from there, otherwise the only way to uninstall the Agent is to run the uninstall in safe mode.

The command depending on it being 32 or 64 bit is:

"C:\Program Files\Webroot\WRSA.exe" -uninstall

"C:\Program Files (x86)\Webroot\WRSA.exe" -uninstall

You can see this on lines 54 and 55 of the script.
I can't remember if I had issues with it running in silent mode or not.

If the Agent is indeed unmanaged these commands should work just fine.

If you need the Agent to check into the console, (ie its missing and you need to make change the policy to unmanaged), you can use the "-poll" command.

Example: "c:\program files\webroot\wrsa.exe" -poll

This will allow the agent to check in and you can deactivate it from there.

https://docs.webroot.com/us/en/business/wsab_endpointprotection_adminguide/Content/ManagingEndpoints/RunningCommandsAtEndpoints.htm

Hope this helps!

@mark05e
Copy link
Author

mark05e commented Oct 21, 2022

Thank you for your notes @CKurti-MCMTSG !

@DomingoMontoya
Copy link

DomingoMontoya commented Dec 17, 2022

I just ran it and it worked fine, but the caveat there is that I was using MeshCentral to run it remotely and the MeshCentral shell runs as user SYSTEM.

I couldn't get rid of it from the desktop Administrator account, and psexec (from sysinternals suite) wouldn't elevate me to SYSTEM.

So, if you have RMM on the system that can run scripts and it runs as SYSTEM, it will probably work.

And the one I removed was managed as well.

@kzieres61
Copy link

Just an update, I know this thing is from 2022, but I just used it 09.28.23 using the RMM (system user) and it 100% removed webroot!!!!

This was a LIFE SAVER Thank you!

@AndyHendriksNL
Copy link

Thank you for this script, ran this today (20-10-2023) with an agent procedure in Kaseya. It executes the powershell as the SYSTEM user, worked like a charm.

@mark05e
Copy link
Author

mark05e commented Oct 21, 2023

Thank you for sharing your experience @DomingoMontoya @kzieres61 @xAndyxNL

@Westone58
Copy link

02/22/2024: Successfully ran this script remotely (from a local server to a W10-64 domain member) via a psexec window started as SYSTEM (psexec -s \remote_workstation_name cmd), then invoked powershell in the psexec window and ran the script. Following reboot, all WebRoot services and folders were gone from the workstation. This will be a time saver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment