Within PowerShell, this is very easy to do.
The below block of script will take a computer name, your username and password, connect to the remote computer and list all installed software by name:
$computerName = "SomeComputerName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_Product | Select Name
}
When you have the name of the product you want to uninstall remotely - you can the perform an uninstall like this:
$computerName = "SomeComputerName"
$appName = "AppName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
$_.Uninstall()
}
}
In the above eaxmples - replace "SomeComputerName" with the name of the computer you wish to uninstall from.
You can also make the script prompt you for a computer name if you prefer with the following line:
$computerName = Read-Host "Enter Computer Name"
If you have multiple computers with the same piece of software that you want to uninstall - you can also define an array of computers to work with and do uninstalls from lots of machines:
$computerNames = @("SomeComputerName1", "SomeComputerName2", "SomeComputerName3")
$appName = "AppName"
$yourAccount = Get-Credential
ForEach ($computerName in $computerNames) {
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
$_.Uninstall()
}
}
}
Answer from Fazer87 on Stack ExchangeWithin PowerShell, this is very easy to do.
The below block of script will take a computer name, your username and password, connect to the remote computer and list all installed software by name:
$computerName = "SomeComputerName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_Product | Select Name
}
When you have the name of the product you want to uninstall remotely - you can the perform an uninstall like this:
$computerName = "SomeComputerName"
$appName = "AppName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
$_.Uninstall()
}
}
In the above eaxmples - replace "SomeComputerName" with the name of the computer you wish to uninstall from.
You can also make the script prompt you for a computer name if you prefer with the following line:
$computerName = Read-Host "Enter Computer Name"
If you have multiple computers with the same piece of software that you want to uninstall - you can also define an array of computers to work with and do uninstalls from lots of machines:
$computerNames = @("SomeComputerName1", "SomeComputerName2", "SomeComputerName3")
$appName = "AppName"
$yourAccount = Get-Credential
ForEach ($computerName in $computerNames) {
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
$_.Uninstall()
}
}
}
If you create a file called "servers.txt" and place your list of servers in it you could also reference $computerNames as follows:
$computerNames = Get-Content "C:\some-directory\servers.txt"
$appName = "AppName"
$yourAccount = Get-Credential
ForEach ($computerName in $computerNames) {
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
$_.Uninstall()
}
}
}
I've used this approach many times in production environments and it seems to work for me. Always test this in a non-production environment before completing in a prod environment.
Using a Command Line to Uninstall Software on Remote PCs - IT & Tech Careers - Spiceworks Community
Remotely Uninstall Software
Uninstall an app on a remote machine!
Remote/silent uninstall of applications from computers
Videos
Every program that properly installs itself according to Microsoft's guidelines makes a registry entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall. Usually, the key for the program will be its GUID, or else the name of the program. Within that key will be an entry called UninstallString. This contains the command to execute to uninstall the program.
If you already know ahead of time what you will be uninstalling, it should be easy enough to just put that in your batch file. It gets tricky when you try to automate that process though. You can use the reg command to get data from the registry, but it returns a lot of text around the actual value of a given key, making it hard to use. You may want to experiment with using VBscript or PowerShell, as they have better options for getting data from the registry into a variable.
You can invoke the correct uninstaller without knowing the GUID, etc. by using WMIC.
To see a list of the names of the programs as known internally by Windows:
wmic product get name
Look for your product name. It probably matches the one listed in the "Programs and Features" control panel, but not always.
Then you can use
wmic product where name="_my_product_name" call uninstall
to perform the uninstall, which AFAIK should be silent (it has been in my experience, but try it before you bet the farm on that. Silence may depend on how your installer/uninstaller was built).
See here for more:
- WMIC: the best command line tool you've never used (overview of WMIC with lots of cool commands described)
- Windows: Uninstall an Application from the Command Line (the specific recipe)
There's also reference documentation for WMIC on microsoft.com.
Hey Defenders of the Systems of the Universe,
Anyone know of a tool that can uninstall software remotely, that is me being able to uninstall software on someone else's computer? Here's some background:
My team uses BigFix to push software and the majority of our users do not have local admin rights on their machines. For us to create an uninstall job from .exe files can be challenging and/or time consuming. I need to empower my help desk to be able to uninstall software even if an uninstall job does not exist. Caveats:
The helpdesk has an elevated AD account that gives them local admin rights to any machine. I know that they can remote into the user's machine, temporarily give the user local admin rights, and uninstall said software. I also know that they can just RDP into the user's box and uninstall software using their aforementioned elevated accounts. Looking for an 'easier' solution for them.
I know there is a way to remove software remotely using the cmd line and registry. Expecting them to use that method is out of the question as it is too complex and/or detailed for them.
Anyone know if any tools that would allow the uninstalls?
Hi Guys,
I am looking for an efficient way to uninstall a program on a remote machine using PowerShell or combination of PowerShell and Intune. I would really appreciate if I can get some guidance on this.
I have seen some forums talking about using Wmi object and it requires winrm enabled. That brings my second question do I have to enable it on my machine or does it have to be enabled in the remote machine as well. Sorry this might be a dumb question but I’m still learning.
N.B: I can uninstall msi app using get-package -name | remove-package
However, it doesn’t work with exe installation. Would love some ideas on that.
TIA!
Here’s a how-to on one method that can be done via command line: http://community.spiceworks.com/how_to/show/179-using-a-command-line-to-uninstall-software-on-remote-pcs
In addition to this, and to others’ suggestions about creating a policy and covering your *ss, I’d also recommend that you follow up with users, maybe with a friendly email saying “I saw you had X installed, it’s against policy, so it’s now been removed from your workstation.” Otherwise you can expect to see things get reinstalled on a good percentage of machines, and then you have to start all over. In addition, a friendly reminder to people about what’s permitted and what’s not is an effective technique for informing users that you’re aware of what’s happening on your network. It’s a subtle way of letting them know you’re watching.
cduff has posted the same link in the meantime.

I am new to this job so i do not want to be that guy that goes to every computer while they are working and start removing software. People that have been here for awhile are to comfortable and download pretty much what ever they want like coupon bars, uturrent, and so on. I want to do a silent uninstall so they do not realize what just happened and forget that it’s even there. Just to many unwanted software that Spiceworks picked up and I want to remove them. What’s the easiest way to do this?