rj07thomas

Untitled

Aug 19th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $wsusServer = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer()
  2. $wsusUpdates = $wsusServer.GetUpdates()
  3. $wsusUpdateIDs = $wsusUpdates.ID
  4. $wsusUpdateSuperseded = $wsusUpdates.HasSupersededUpdates
  5.  
  6. ForEach($update in $wsusUpdates)
  7. {
  8. If($update.IsSuperseded -eq $true)
  9. {
  10. 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 Yellow
  11. $update.Decline()
  12. }
  13. ElseIf($update.IsSuperseded -eq $false)
  14. {
  15. Write-Host "Is superseded:"$update.IsSuperseded`t -NoNewLine -ForegroundColor Green; Write-Host $update.KnowledgebaseArticles"" -NoNewLine -ForegroundColor Blue; Write-Host $update.ID.UpdateID"" -NoNewLine; Write-Host $update.Title"" -ForegroundColor Yellow
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment