Advertisement
Guest User

Untitled

a guest
May 18th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # WSUSCleanup.ps1
  2.  
  3. [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")` | out-null
  4. $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
  5. $cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope;
  6. $cleanupScope.DeclineSupersededUpdates = $true      
  7. $cleanupScope.DeclineExpiredUpdates = $true
  8. $cleanupScope.CleanupObsoleteUpdates = $true
  9. $cleanupScope.CompressUpdates = $true
  10. $cleanupScope.CleanupObsoleteComputers = $true
  11. $cleanupScope.CleanupUnneededContentFiles = $true
  12. $cleanupManager = $wsus.GetCleanupManager();
  13. $cleanupManager.PerformCleanup($cleanupScope);
  14. # Script END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement