Sunday, July 29, 2018

Uninstall a Software from Remote Computer

Using Powershell We can uninstall a software from a Remote Computer

# 1 ) We need to know the Product ID of the Software which we would be installing


$computers = @("Some Computer Name")
foreach($server in $computers){
    $app = Get-WmiObject -Class Win32_Product -computer $server | Where-Object {
        $_.IdentifyingNumber -match "product Id of the Software"
    }
    $app.Uninstall()
}

No comments:

Post a Comment