🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

WSUS Server Health & Compliance Audit with PowerShell (2026)

WSUS Server Health & Compliance Audit with PowerShell (2026)
WSUS server health audit with PowerShell - Dargslan 2026

WSUS rots quietly. Synchronisation fails for two months and nobody notices, the database hits the 200 GB mark and queries crawl, half the clients stop reporting because their client ID got duplicated. None of that shows in a green icon. The audit has to actually ask the WSUS API.

This guide audits WSUS server status, client compliance and missing critical updates from PowerShell, and ships the Dargslan.WsusHealth module plus a free PDF cheat sheet.

Step 1: Server status + last sync

Connect via the Microsoft.UpdateServices.Administration assembly:

[reflection.assembly]::LoadWithPartialName('Microsoft.UpdateServices.Administration') | Out-Null
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer('wsus01', $false, 8530)
$wsus.GetStatus()
$wsus.GetSubscription().GetLastSynchronizationInfo() | Select StartTime, Result

Targets: last sync within 48 hours, last sync result Succeeded. Anything older points at a network or upstream WSUS issue.

Step 2: Client compliance buckets

$summary = $wsus.GetSummariesPerComputerTarget(
    (New-Object Microsoft.UpdateServices.Administration.UpdateScope),
    (New-Object Microsoft.UpdateServices.Administration.ComputerTargetScope))
$summary | Group-Object {
    if ($_.NotInstalledCount + $_.DownloadedCount + $_.FailedCount -eq 0) { 'UpToDate' }
    elseif ($_.FailedCount -gt 0) { 'Failed' }
    else { 'NeedingUpdates' }
} | Select Name, Count

Defensible target: ≥ 90 % UpToDate, ≤ 5 % Failed.

Step 3: Missing critical updates

Filter the update scope to Critical Updates and Security Updates only, then list clients with NotInstalledCount > 0. The module's Get-DargslanWsusMissingCritical -Top 50 returns the worst offenders sorted descending.

Step 4: Server cleanup

Run the WSUS Server Cleanup Wizard quarterly — it deletes superseded updates, computer records that have not contacted in 30 days and unneeded files. From PowerShell:

$cleanup = New-Object Microsoft.UpdateServices.Administration.CleanupScope
$cleanup.DeclineSupersededUpdates = $true
$cleanup.DeclineExpiredUpdates    = $true
$cleanup.CleanupObsoleteUpdates   = $true
$cleanup.CompressUpdates          = $true
$cleanup.CleanupObsoleteComputers = $true
$cleanup.CleanupUnneededContentFiles = $true
$wsus.GetCleanupManager().PerformCleanup($cleanup)

A pragmatic PASS / WARN / FAIL score

  1. Last sync within 48 h (1 pt)
  2. Last sync result Succeeded (1 pt)
  3. ≥ 90 % clients UpToDate (1 pt)
  4. ≤ 5 % clients Failed (1 pt)

4/4 PASS, 2-3 WARN, 0-1 FAIL.

Dargslan.WsusHealth module

Install-Module Dargslan.WsusHealth -Scope CurrentUser
Import-Module Dargslan.WsusHealth
Export-DargslanWsusHealthReport -Server wsus01 -Port 8530 -OutDir C:\reports

FAQ

What about Windows Update for Business / Intune?

Different model — Intune compliance reports replace WSUS. The audit logic does not apply.

Cleanup wizard times out

Run the cleanup steps individually, smallest first, with a window of several hours. Old WSUS DBs need EXEC spDeleteUpdate against SUSDB to make progress.

Cheat sheet?

Free PDF at /cheat-sheets/wsus-server-health-audit-2026.

Related Dargslan resources

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.