Require a Password to Uninstall/Remove Application

How can i Uninstall Password Protected Application using cmd/powershell in windows

AFAIK password protecting installers isn't built-in to MSI installers and would be a custom uninstallation feature provided by the software maintainer. You will need to reference the software manufacturer's documentation on removing the software via automation.

Note: Avoid using the Win32_Product class, as simply enumerating it will trigger a reconfigure on any installed products that fail the integrity check which happens when you enumerate a given Win32_Product. Dumb, I know, but it's just how that WMI class works. My answer above offers an alternative way to list installed products and you can get the uninstallation information directly from the same registry location as well.

Once you get the program's ProductCode, you can run

msiexec /x PRODUCTCODE ADDITIONAL_PARAMETERS

to uninstall the software. The password will likely be provided by an MSI parameter the software maintainer should have documented or be able to tell you, and will come after any additional logging arguments to msiexec.


If you are trying to do this with software installed with an EXE installer that does not use an embedded MSI to install the software, you will be entirely at the whim of the software maintainer for how to uninstall the program via automation, as non-MSI installers do not have the standard Microsoft Installer properties associated with them, nor can you remove these with msiexec.

how to prevent application to be uninstalled by a user (w/o admin rights)?

[updated]
the file location is easy. That is simple revoking write permission on the folder and all its subfolders and files for Builtin\Users, and giving Builtin\Administrators full permmision. You can set this via the Explorer, properties-> permissions or commandline wise with cacls (or icalcs if you're on win7)

The regkey is on my win7 box already only readable (not writeable) by Users and read/write by local admins (regedit -> Context menu -> Persmissions).

If it still doesn't behave like you want figure out what groups a normal user is in (also domain groups) and then check how those groups are propagated to the local machine.

And as sugested by Ben in the comments, you might start a new question on Server Fault.

[end update]

[before edite response]
I doubt you can disallow the uninstall of 'one' application. By means of a Group Policy you can "Pohibit removal of updates"

(in GPedit.msc under Computer Config/Admin templates/windows components/windows installer)

The Group Policy is set by a domain admin and is enforced across the domain so it doesn't require 'persmissions'. But you need off course to also prevent local admins from editing the local group policy.

Another more daunting option would be to use a group policy in the Software Rectriction part of Security Settings. Here you can enter a path policy for the name of the msi or exe file that you do not want to be run.

Both require validating/testing to prevent that to much restriction prevent everybody from starting anything...

ClickOnce uninstall for normal non admin accounts

The solution is to use the Control Panel to de-install the app.

There I have no problems removing an application that I as non admin user installed



Related Topics



Leave a reply



Submit