none
Need help to correct WSUS Updates Approval script RRS feed

  • Question

  • Hi everyone,

    I am not good with powershell scripting. I was just trying to write something below to approve WSUS updates but getting failed. Please help me to correct. specially to bind the $updates files to approval command.

    [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")

    $wsus =[Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(“wsusserver”,$False,8530)

    $updates =Get-Content"FilePath\KB_updates.txt"

    $groups =Get-Content"FilePath\Groups_Week1.txt"

    #To search updates

    $wsus.searchupdates($_)

      if(!$Updates){

    #do nothing if update not found 

    Write-Host"$_not found"

        } 

    else{

        }

    #To Approve updates

    Get-WSUSUpdate-UpdateId$updates|Approve-WSUSUpdate-Group$Groups-ActionInstall

    Wednesday, July 1, 2020 9:19 PM

All replies