Power shell Script for WSUS disk clean up in windows
4:48 PM
01
02
03
04
05
06
07
08
09
10
11
| [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 ); |
0 comments