rj07thomas

List unwanted updates in WSUS

Mar 3rd, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
  2.  
  3. Clear-Host
  4.  
  5. $script:wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer('<servername>', $false, '8530')
  6. $wsus03
  7. $unwantedUpdates = $wsus.GetUpdates() | Where-Object {$_.IsDeclined -like 'False' -and $_.IsSuperseded -like 'True'}
  8. <#$unwantedUpdates.Title
  9. $unwantedUpdates.Count#>
  10.  
  11. ForEach($update in $unwantedUpdates)
  12. {
  13. $update.Title
  14. }
  15. Write-Host ""
  16. $unwantedUpdates.Count
Advertisement
Add Comment
Please, Sign In to add comment