Advertisement
rj07thomas

Untitled

Aug 19th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 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]$declinedCounter = 0
  6.  
  7. ForEach($update in $wsusUpdates)
  8. {
  9. If($update.IsDeclined -eq $true)
  10. {
  11. Write-Host "Is declined:"$update.IsDeclined`t -NoNewLine -ForegroundColor Red; Write-Host $update.KnowledgebaseArticles"" -NoNewLine -ForegroundColor Blue; Write-Host $update.ID.UpdateID"" -NoNewLine; Write-Host $update.Title"" -ForegroundColor Yello
  12. $declinedCounter++
  13. }
  14. }
  15.  
  16. Write-host "Total number of declined updates is"$declinedCounter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement