Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # WSUSCleanup.ps1
- [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")` | out-null
- $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
- $cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope;
- $cleanupScope.DeclineSupersededUpdates = $true
- $cleanupScope.DeclineExpiredUpdates = $true
- $cleanupScope.CleanupObsoleteUpdates = $true
- $cleanupScope.CompressUpdates = $true
- $cleanupScope.CleanupObsoleteComputers = $true
- $cleanupScope.CleanupUnneededContentFiles = $true
- $cleanupManager = $wsus.GetCleanupManager();
- $cleanupManager.PerformCleanup($cleanupScope);
- # Script END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement