How to remotely uninstall a user software

  1. Open cmd with elevated user.
  2. Step into wmic – C:\Windows\system32>wmic.
  3. Verify Program Installation
    1. /node:COMPUTERNAME product get name,version,vendor – This command asks WMI to reply with a list including the Name, Version, and Vendor of all compliant software installations.
    2. /node:ANOTHEREXAMPLE product where vendor=”Apple Inc.” get name,vendor – This command asks WMI to reply with a list including name and vendor of all apple software.
  • If you have special characters like ‘-‘ or ‘/’ in the computer name you need to use ‘ ‘ characters in order to get information from client).
  • Here is how you use wildcards in your search:

Surround the like phrase in double quotes and your search criteria in single quotes, and use % as the wildcard symbol.

e.g.:

/node:ComputerXYZ product where “vendor like ‘adobe%'” get name,version,identifyingNumber )

  1. Call for the Uninstallation – /node:EXAMPLE product where name=”MobileMe Control Panel” call uninstall. It will prompt you for confirmation in the following (long) format:

Execute (\\EXAMPLE\ROOT\CIMV2:Win32_Product.IdentifyingNumber=”{6DA9102E-199F-43A0-A36B-6EF48081A658}”,Name=”MobileMe Control Panel”,Version=”2.1.0.24″)->Uninstall() (Y/N/?)?

To which you must reply ‘y’ if you wish to uninstall. WMI compliant software will run the default uninstallation procedures without the user needing to do anything (they receive no prompts etc).

  • you may also use the

/nointeractive flag like /node:EXAMPLE product where name=”MobileMe Control Panel” call uninstall /nointeractive to prevent the confirmation request!

  1. Call Uninstall for a List of Machines (an optional informative step)
  1. Let’s assume you just got word that Adobe Reader has a serious flaw in it’s old version. In a panic, you asked all your users to blindly install the new version of Adobe reader straight from Adobe’s site. Thankfully, they all managed to do so… however you’ve received 3 tickets so far about an Acrobat.com icon on the desktop.

You have a flat text file of all your computer’s names stored in c:\computers.txt. You pop open a WMIC shell with appropriate permissions and enter the following command:

>/failfast:on /node:@”c:\computers.txt” product where name=”Acrobat.com” call uninstall /nointeractive

Which iterates through your list, skipping nodes that are invalid (eg:machine is turned off) and those that don’t meet the criteria. You’ll need to confirm ‘y’ that you want to uninstall on every node unless you use the nointeractive flag.

* Updated Note from Bart2691

… an easy way to automate answering ‘Yes’. Examples for doing it by PC or a text file is to use the /nointeractive flag. Additionally, if you don’t wish to hang on failed nodes, use the /failfast:on flag to quickly skip a node that isn’t responding.

** note from true911 (unconfirmed)

The correct flag is failfast:on, not fastfail:on

wmic /failfast:on /node:@”FILENAME.txt” product where “name like ‘microsoft office professional edition 2003′” call uninstall /nointeractive

via:

http://community.spiceworks.com/how_to/show/179-using-a-command-line-to-uninstall-software-on-remote-pcs