Advertisement
rj07thomas

Find superseded WSUS updates

Aug 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. $wsusServer = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer()
  2. $wsusUpdates = $wsusServer.GetUpdates()
  3. $wsusUpdateIDs = $wsusUpdates.ID
  4. $wsusUpdateSuperseded = $wsusUpdates.HasSupersededUpdates
  5. [int]$supersededCounter = 0
  6.  
  7. ForEach($update in $wsusUpdates)
  8. {
  9. If($update.IsSuperseded -eq $true)
  10. {
  11. Write-Host "Is superseded:"$update.IsSuperseded`t -NoNewLine -ForegroundColor Red; Write-Host $update.KnowledgebaseArticles"" -NoNewLine -ForegroundColor Blue; Write-Host $update.ID.UpdateID"" -NoNewLine; Write-Host $update.Title"" -ForegroundColor Yello
  12. $supersededCounter++
  13. }
  14. }
  15.  
  16. Write-host "Total number of superseded updates is"$supersededCounter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement