none
Uninstall software - Uninstall String RRS feed

  • Frage

  • Hi, 

    ich möchte eine Software für mehrere Server mit dem Uninstall String remote deinstallieren. 

    Der Uninstall String lautet C:\Program Files (x86)\HPE\PowerProtector\mc2.exe -uninstall

    Mein Problem liegt darin, dass ich nicht weiß, wie ich den Uninstall String dann korrekt aufrufe, sodass die Applikation deinstalliert wird .. Kann mir jemand helfen? Zwei Varianten hab ich probiert ... 

    Besten DANK! LG 

    $computerNames = get-content Pfad der Liste mit Serverhostnamen 
    $Account = Get-Credential
    
    ForEach ($computerName in $computerNames) {
        Invoke-Command -ComputerName $computerName -Credential $Account -ScriptBlock {
            start-process "C:\Program Files (x86)\HPE\PowerProtector\mc2.exe -uninstall"
            }
        }
    
    $computerNames = get-content Pfad der Liste Serverhostnamen
    $Account = Get-Credential
    $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    $app= Get-ChildItem $RegPath| Get-ItemProperty | Where-Object {$_.DisplayName -match "hpe" } 
    
    ForEach ($computerName in $computerNames) {
        Invoke-Command -ComputerName $computerName -Credential $Account -ScriptBlock {
            $app.UninstallString
            }
        }
    


    Mittwoch, 16. Dezember 2020 08:56

Antworten

Alle Antworten