Uninstall Program in SCCM with Toolkit

Hi there,

I am new to using the toolkit, and I can get it to do what I want, but not inside of an SCCM Application. I am using the deployment exe with the Uninstall parameter, and the code for my uninstall inside of the Deployment-Uninstall.ps1 is as follows

Execute-MSI -Action Uninstall -Path ‘{0CFCE2E6-4671-47E6-9032-91DE15B8AC40}’ -ContinueOnError $true

This runs fine if ran manually on the box as “Deploy-Application.exe Uninstall” - However, if I put this into SCCM as an application and run that same command, it runs with no error, but does not uninstall the program. Also, if use PSEXEC -i -s cmd.exe and run the same command elevated as SYSTEM - it does not uninstall either. Can anyone assist me with why this will not run in the SYSTEM context?

What does the log file say? Per default located under %windir%\Logs\Software<your-application>_PSAppDeployToolkit_Uninstall.log

In SCCM are you putting the command (Deploy-Application.exe Uninstall) into the ‘Install’ or ‘Uninstall’ program? What I have done in the past is create an application with both the install and uninstall programs set correctly as if I was going to install the application. I then deployed the ‘Uninstall’ to the collection. Removes the application really easily.

Is this a user based application, like Google Chrome? One way to test is to login as a different user and see if the application is listed in Programs and Features.