One of the frustrations of working for a very large company is that the company provided laptop does not have a local admin account (or rather, only IT support has access to such an account). Now while this laptop has tools that are supposed to allow me access to admin privs if needed, in practice there are some frustrating gaps.
One such gap is uninstalling programs. And not just programs that I want to remove because I think it is useful for my work, but programs that the IT department's security tool has mandated I remove (and threatened to lock my user account if I do not do so promptly).
So the company gives me a laptop and installs a security scanner tool that threatens to lock me out if I don't remove something that I can't remove because of security restrictions. Gee, thanks.
Like I said, this laptop comes with a tool (Avecto Defendpoint) which gives me access to Admin Privs when running certain programs. For some reason (I'm no expert in Windows System Management) it doesn't work well with Add/Remove Programs. But I can use it to open PowerShell as an admin. Then it's actually quite easy: I run msiexec to uninstall the program.
First, msiexec needs to know the Product ID of the program I want to uninstall. To get that, I run this in PowerShell:
PS C:\> get-wmiobject Win32_Product | Format-Table IdentifyingNumber, Name
This prints out a nice table containing the Product ID and the name of the program. For example, here's the row containing the JDK:
{71307D56-8005-5F5E-9227-BFA2754D6E54} Java(TM) SE Development Kit 10.0.2 (64-bit)
Now all I need to do is run msiexec like this:
PS C:\> msiexec.exe /uninstall "{71307D56-8005-5F5E-9227-BFA2754D6E54}"
I follow the prompts as usual and then I'm done. The security tool is happy and stops threatening me.