Powershell – Uninstall Symantec Endpoint Protection 12.1 (with uninstall password) using PowerShell

powershellwindows 7windows-server-2008

We just acquired 400 or so computers during a buyout and they have this installed.

So I tried pushing out

(Get-WmiObject -Class Win32_Product -Filter "Name='Symantec Endpoint Protection'" -ComputerName . ).Uninstall()

as per https://support.symantec.com/en_US/article.TECH102470.html which unsurprisingly doesn't work. I was getting ReturnValue 1602 and not ReturnValue 0.

Tried uninstalling it manually on a client using Add/Remove Programs and it needs a password which I've now managed to get from the old company.

Any idea how we can use PowerShell to uninstall this with a password?

It's SEP 12.1.

Best Answer

Remove the uninstall password requirement via registry and run the same WMI command.

HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\Symantec Endpoint Protection\AV\AdministratorOnly\Security\UseVPUninstallPassword
Set to 0 to disable