Login to participate
Endpoint Management & Virtualization ArticlesRSS

Automatically Remove a Program From Computers

Alon's picture

Ever wanted remove an unwanted program from all computers that have it installed? Well here's how.

First off here is a couple assumption for my example.

  • Assumption 1: This is only for a single program
  • Assumption 2: You know the uninstall command. If it is an MSI you can find out the uninstall GUID from the Add Remove Programs section of a machine's inventory (or directly from the table Inv_AeX_OS_Add_Remove_Programs)

Using my example you should be able to cater this to whatever your needs are.

I am purely utilizing Task Server for this.

What needs to be done is to create a server side job that has 2 tasks, one will query the NS for all machines that have the application, and the second task to run the uninstall command on each of those machines.

The first task will pass it's result to the second task.

First I created a client side script that had the following lines:

newcommand="msiexec.exe /uninstall " + "{BA3C8C28-C096-450B-B78C-5EA939A073D4}" + " /q"
Set WshShell = WScript.CreateObject( "WScript.Shell" )
WshShell.Run newcommand

Replace the GUID with the appropriate uninstall GUID. Again, this will be specific to a single application. This is also assuming the application is an MSI install. If not, then simply enter the appropriate uninstall command.

Next create a server side job where the first task is a run query with the following SQL:

use Altiris
select _ResourceGuid from
dbo.Inv_AeX_OS_Add_Remove_Programs
where Name = 'Your Application'

Replace "Name=" with whatever application you are looking for. Next you need to select "Save query output" and return query output as "computer list".

The next task in that job will be the script I listed above. Choose the "Add Existing" button from the job and select the script name that you created. Now what you need to do is "enter task input now" on the ride hand side and select the results from the previous task.

That's it.

Next you can schedule this job to run as often as you need.

I included the xml of both the script and the job for you to import. You will need to change the file extension of both files from .txt to .xml. I also used the application called "Trinket" in my examples in the xml. Simply change "Trinket" to whatever application you are looking to remove.

License: Altiris EULA
By downloading this software, you agree to the terms and conditions in the Altiris End User License Agreement
Support: User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab.
timonokinawa's picture

Great tip

many applications have this cryptic uninstall guid. you can also use those guids to script uninstall tasks from the deployment console