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 Exchange
🌐
Spiceworks
community.spiceworks.com › software & applications
Uninstall software remotely using the command line - Software & Applications - Spiceworks Community
February 11, 2019 - In this manual, I will show how you can uninstall software remotely from your computer using the command line (and not delete files, but uninstall the program), without going into the control panel and running the Progra…
Top answer
1 of 2
2

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()
        }
    }
}
2 of 2
0

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.

Discussions

Using a Command Line to Uninstall Software on Remote PCs - IT & Tech Careers - Spiceworks Community
WMIC (Windows Management Instrumentation Command-Line) is a potent tool that often doesn’t see much use due to the lack of (easily accessible) documentation available. More information can be found on WMIC here: WMIC - Take Command-line Control over WMI | Microsoft Learn. More on community.spiceworks.com
🌐 community.spiceworks.com
1357
January 7, 2009
Remotely Uninstall Software
Just a quick chime in for the Powershell Deployment Toolkit. If they can run PowerShell scripts, this has some dead-simple ways to uninstall software. Remove-MSIApplications -Name 'Adobe Flash' OR Execute-Process -Path 'Adobe_flash_player.exe' -Parameters '/uninstall' -WindowStyle 'Hidden' It has lots of options, and can be run with a GUI or not. More on reddit.com
🌐 r/sysadmin
30
29
December 13, 2016
Uninstall an app on a remote machine!
Im pretty sure using WMI is not the best way of doing this - If you've got a way to find out the uninstall string for that particular software (ie it's installed on a machine you have access to), you can run that uninstall string from CMD/PoSH x86 = HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall x64 = HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall More on reddit.com
🌐 r/PowerShell
17
5
May 26, 2020
Remote/silent uninstall of applications from computers
Hello!I am currently trying to uninstall software remotely and silently from a users computer. I wanted to know if anyone knew of a way to do this via kace or is their a way to do it via a script. I k More on itninja.com
🌐 itninja.com
4
May 28, 2020
🌐
AirDroid
airdroid.com › home › remote support › how to uninstall software remotely on windows
How to Uninstall Software Remotely on Windows – AirDroid
July 12, 2024 - Step 3. Uninstall a specific program using the ‘Invoke-WmiMethod‘ cmdlet: Invoke-WmiMethod -Class Win32_Product -Name Uninstall -ArgumentList $null -ComputerName "RemoteComputerName" -Filter "Name='ProgramName'" Step 4. Creating PowerShell scripts enhances automation and scalability: $computers = Get-Content "C:\computerlist.txt" $programName = "Software to Uninstall" foreach ($computer in $computers) { Invoke-Command -ComputerName $computer -ScriptBlock { $program = Get-WmiObject -Class Win32_Product -Filter "Name='$using:programName'" if ($program) { $program.Uninstall() Write-Host "$using:programName uninstalled from $env:COMPUTERNAME" } } }
🌐
Action1
action1.com › home › blog › how to uninstall software remotely via command line tool
How to Uninstall Software Remotely with Command Line Tool
December 5, 2024 - product where name = ”program name” call uninstall in this case, you will be asked to confirm the action before uninstalling. If you add the / nointeractive parameter, the query will not appear. When the program is completed, you will see the message Method execution successful. You can close the command line. You need to perform an action on multiple computers simultaneously. You have remote employees with computers not connected to your corporate network. Action1 is a cloud-based platform for patch management, software deployment, remote desktop, software/hardware inventory, endpoint management, and endpoint configuration.
Top answer
1 of 8
21

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.

2 of 8
32

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.

🌐
Spiceworks Community
community.spiceworks.com › it & tech careers
Using a Command Line to Uninstall Software on Remote PCs - IT & Tech Careers - Spiceworks Community
January 7, 2009 - WMIC (Windows Management Instrumentation Command-Line) is a potent tool that often doesn’t see much use due to the lack of (easily accessible) documentation available. More information can be found on WMIC here: WMIC - Take Command-line Control over WMI | Microsoft Learn.
🌐
GFI Blog
techtalk.gfi.com › home › how to uninstall software from remote pcs using the command line
How to uninstall software from remote PCs using the command line
September 4, 2019 - You may need to remove it because ... If you need to remove software from a remote machine you can do so using a combination of PSEXEC and MSIEXEC....
Find elsewhere
🌐
Hasanaltin
hasanaltin.com › how-to-remove-software-remotely-using-psexec
How to remove software remotely using PsExec – Hasan Altin
July 29, 2023 - C:\Windows\system32>wmic product where name="Java 8 Update 321 (64-bit)" call uninstall /nointeractive Executing (\\MRTVDIDEMO-003\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{26A24AE4-039D-4CA4-87B4-2F64180321F0}",Name="Java 8 Update 321 (64-bit)",Version="8.0.3210.7")->Uninstall() Method ...
🌐
Action1
action1.com › home › blog › how to uninstall software remotely using wmi on windows?
How to Uninstall Software Remotely Using WMI on Windows? | Action1
March 21, 2025 - The “Run” window will open ... type “cmd” and click OK. In the command window that opens, type “wmic” and press “Enter.” · Thus, we launched a console utility for interacting with the WMI structure on a local or remote computer. Now using the WMI Query Language (WQL), you can execute various WMI commands. For example, we get the entire list of installed software on a remote ...
🌐
Reddit
reddit.com › r/sysadmin › remotely uninstall software
r/sysadmin on Reddit: Remotely Uninstall Software
December 13, 2016 -

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:

  1. 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.

  2. 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?

🌐
Reddit
reddit.com › r/powershell › uninstall an app on a remote machine!
r/PowerShell on Reddit: Uninstall an app on a remote machine!
May 26, 2020 -

Hi Guys,

  1. 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.

  2. 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!

🌐
AirDroid
airdroid.com › home › remote control › [100% working] how to install/uninstall software using cmd?
[100% Working] How to Install/uninstall Software Using Cmd? – AirDroid
August 21, 2024 - Step 4.Finally, type PsExec.exe \\REMOTE-PC\ -i -s msiexec.exe /i “c:\installer.msi” /qn /norestart to execute the installer on the remote PC. Steps to Uninstall Software with Cmd on a Remote Computer
🌐
NirSoft
nirsoft.net › articles › uninstall_software_remotely.html
How to uninstall software on remote Windows machine
How to uninstall software on remote Windows computer, using the UninstallView tool of NirSoft and PsExec tool of Sysinternals
🌐
4sysops
4sysops.com › home › blog › articles › uninstall programs (remotely) with powershell
Uninstall programs (remotely) with PowerShell – 4sysops
July 28, 2023 - In addition, separate cmdlets exist for Store and UWP apps with Remove-AppxProvisionedPackage and Remove-AppxPackage. Finally, it is possible to uninstall applications using WMI. This is the only mechanism mentioned here that can perform this task remotely. ... The class Win32_Product is responsible for this. With its help, you can first view the installed software...
🌐
Windows OS Hub
woshub.com › uninstall-apps-with-powershell-windows
Uninstalling Apps Using PowerShell or CMD on Windows 11 and 10 | Windows OS Hub
1 week ago - For example, to uninstall Microsoft Office on a remote computer, run the command below: $apps = Get-WmiObject -Class Win32_Product -ComputerName wkmn-man23 |where name -Like "Office 16 Click-to-Run*" $apps.uninstall() The Get-WmiObject command is not supported in newer versions of PowerShell Core. Instead, use the Get-CimInstance cmdlet. List the installed software...
🌐
Up & Running Inc
urtech.ca › 2019 › 09 › solved-command-line-to-uninstall-software-exes-or-msis
SOLVED: Command Line To Uninstall Software EXE's or .MSI's - Up & Running Inc - Tech How To's
February 21, 2023 - Figure out what the GUID of the ... Either in a CMD window running as an ADMIN or a script running as an ADMIN msiexec /quiet /norestart /uninstall {<GUID>} like: msiexec /quiet /norestart /uninstall {7FCA6452-46F2-452F-A5A7...
🌐
NinjaOne
ninjaone.com › home › blog › software deployment › 4 ways to remotely uninstall software (and keep it uninstalled with automation)
How to Remotely Uninstall Software with NinjaOne | NinjaOne
April 29, 2025 - Things to include in your script for uninstalling software remotely (using PowerShell as an example): Validate that the software is installed. You can use the Get-WmiObject or Get-ItemProperty cmdlet