Skip to content

Instantly share code, notes, and snippets.

@privatehosting
Created October 19, 2019 21:34
Show Gist options
  • Save privatehosting/fecb1525db2869f355b5e93985d2fadc to your computer and use it in GitHub Desktop.
Save privatehosting/fecb1525db2869f355b5e93985d2fadc to your computer and use it in GitHub Desktop.
PowershellScript to remove replaced or declined updates ...
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$wsus.GetUpdates() | Where {$_.IsDeclined -eq $true} | ForEach-Object {$wsus.DeleteUpdate($_.Id.UpdateId.ToString()); Write-Host $_.Title removed }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment