Provides overall server status counts for a Windows Server Update Services (WSUS) server, presenting information shown at the “Update Services” node of the WSUS console for a specific server. This script was contributed by the Microsoft WSUS team.

The output is comma delimited text:
ServerName,CurrentDate,TotalComputers,TotalUpdates,ComputerTargetsUpToDate,ComputerTargetsNeedingUpdates,
ComputerTargetsWithErrors,UpdatesUpToDate,UpdatesNeededByComputers,UpdatesWithClientErrors

Sample output:

MYSERVER,4/5/2007,131,1527,5,64,6,0,128,9

This script connects to a WSUS 3.0 server on the machine where the script runs. This script can be adapted to connect to remote WSUS 3.0 servers by changing the GetUpdateServer() call to GetUpdateServer(<servername>, true|false), where <servername> is the name of the remote WSUS server, and true|false refers to the use of SSL to make the connection.

PowerShell
Edit|Remove
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$status = $wsus.GetStatus();
$wsus.ServerName+","+[DateTime]::UtcNow.ToShortDateString()+","+$status.ComputerTargetCount+","+$status.UpdateCount+", `
 "+$status.ComputersUpToDateCount +","+$status.ComputerTargetsNeedingUpdatesCount+","+$status.ComputerTargetsWithUpdateErrorsCount+", `
 "+$status.UpdatesUpToDateCount+","+$status.UpdatesNeededByComputersCount+","+$status.UpdatesWithClientErrorsCount;