Showing posts with label WSUS. Show all posts
Showing posts with label WSUS. Show all posts

May 5, 2016

wuauclt "Report Now" vs "Detect Now"

When you execute "wuauclt /detectnow", you are telling the computer to seek for new updates. If it is a managed computer (under WSUS or Patch Manager), that's what it'll check against; otherwise it would be Microsoft's Update Servers.

When you execute "wuauclt /reportnow", you are telling the computer to inform the WSUS/Patch Manager server of its update status.

WSUS Clean - Powershell script

 This little script will perform a clean up of declined and superceded updates in the WSUS database.  It uses the .Net class "Microsoft.UpdateServices.Administration" assembly, which should be loaded on your WSUS server.  Note that this script will stop the WSUS service twice, but these services will be restarted correctly by the script, and no user action is needed.


$outFilePath = '.\wsusClean.txt' 
[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| Out-File -FilePath $outFilePath