locked
Remove Software by PowerShell RRS feed

  • Question

  • Hi Guys,

    I create PowerShell Script to remove software but always show ReturnValue : 1603

    I'm Domain admin , so my permission is Highest authority , I try use admin account and run as administrator but all show 1603.

    remove PC's OS is Win10-1903. WinRM is Open.

    How to solve it? Thanks!

    My Script :

    ###################

    $Date = (Get-Date).ToString("yyyMMdd-HHmm")

    $computers = @(Get-Content 'C:\Test\testmchines.txt')
    foreach ($computer in $computers){
        $Obj = New-Object PSCustomObject -Property @{ComputerName=$computer;TestExists=$false;Uninstalled=$false}

        $Test = Get-WMIObject -Class Win32_Product -Filter "Name Like '%Pulse Secure%'" -ComputerName $computer

        if ($Test){
            $Obj.TestExists = $true
            $result = $Test.Uninstall()
            if ($result -eq 0) {
                $Obj.Uninstalled = $true
            }
        }

        $Obj | Export-Csv D:\pcwork\pulse_$Date.csv -NoTypeInformation -Encoding UTF8
    }


    Hi I can't to find solution for solve this issue, I have Event 364 Source File: /Content/1B/DCD02B975BCC454188A2BB1F036E3E590C25641B.exe Destination File: D:\WSUS\WsusContent\1B\DCD02B975BCC454188A2BB1F036E3E590C25641B.exe But I don't know how to deline this KB Number..

    • Moved by Dave PatrickMVP Wednesday, June 10, 2020 2:05 AM looking for forum
    Wednesday, June 10, 2020 12:59 AM

Answers

All replies

  • I'd try asking for help over here.

    https://social.technet.microsoft.com/Forums/windows/en-US/home?forum=winserverpowershell

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Proposed as answer by Guido Franzke Wednesday, June 10, 2020 6:57 AM
    • Marked as answer by Guido Franzke Wednesday, June 17, 2020 8:13 AM
    Wednesday, June 10, 2020 2:04 AM
  • Thanks..

    I have created on your URL.


    Hi I can't to find solution for solve this issue, I have Event 364 Source File: /Content/1B/DCD02B975BCC454188A2BB1F036E3E590C25641B.exe Destination File: D:\WSUS\WsusContent\1B\DCD02B975BCC454188A2BB1F036E3E590C25641B.exe But I don't know how to deline this KB Number..

    Wednesday, June 10, 2020 2:16 AM
  • Sounds good, you're welcome.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Wednesday, June 10, 2020 2:19 AM