Need to Uninstall Software From Remote Computers on the Cheap? Use WMI CLI
Sometimes you just need to uninstall an application from several (or several hundred) computers and you don’t want to log in to each one individually. This came up recently when I was upgrading and migrating FileMaker 11 to FileMaker 13. If you are a domain admin, one way to do this is to use WMIC (Windows Management Instrumentation Command-line).
First, you will need to find out the product name associated with the piece of software you would like to uninstall. In my case, FileMaker 11.
Let’s say that you don’t have this particular application installed on your local computer. How are you going to find out the correct snytax for the application name? Easy. We will just use the WMIC /node switch.
We will need to open the wmic cli in administrator mode.
Go to Start and type wmic. Once it appears in the search results, hold Ctrl + Shift and press Enter (you can also right-click the wmic icon and select run as administrator).
Once the wmic window is open, run the following command, where computername is substituted with the name of the remote computer you know has the software installed.
/node:”computername” product get name
You must use the quotes around the computer name or it will not work.
After a few moments, you will see a list of software that is installed on the specified computer. Locate the name of the application you want to uninstall and note the name (or keep this wmic window open). The name must be exact or the next steps won’t work. In my case, it was FileMaker Pro 11 Advanced so this is what we will be using in our example.
If you just have one computer to run this against, you can perform the following command, noting the quotes are required around computername and FileMaker Pro 11 Advanced. Remember to substitute the computername and software name with the proper ones for your scenario.
/failfast:on /node:”computername” product where name=”FileMaker Pro 11 Advanced” call uninstall /nointeractive
After a few moments, you will see information about the uninstall process and when completed, you should see Method Execution Successful.
Got more than 1 computer that you need to uninstall software from? No problem.
Create a new text file in Notepad (or Notepad++, my preferred txt editor).
List all the computers by name that you would like to uninstall that piece of software from, each on their own line. Let’s save it to the root of C and call it computers.txt
Now go back to the WMIC window and run the following command, replacing “FileMaker Pro 11 Advanced” with your software name.
/failfast:on /node:@”c:\computers.txt” product where name=”FileMaker Pro 11 Advanced” call uninstall /nointeractive
The command will run against all the computers in the list but goes one by one. I am sure there are faster ways to do this but this one worked fine for me, as it required no intervention once it started. It leaves the WMIC window open so you can review the process and identify successes or any potential issues with computers. It took about 45-60 minutes for the software to run through around 60 desktops.