Export WSUS Computer Inventory with PowerShell
Use Get-WSUSComputer to extract the WSUS client inventory, pick only the fields you need, and export to CSV/JSON for reporting.
Export all attributes
Get-WSUSComputer -All | Format-Table *
Selective export (recommended)
Common fields + resolved group names. Adjust as needed.
$out = "$env:USERPROFILE\Downloads\WSUS_Computers.csv"
Get-WSUSComputer |
Select-Object `
FullDomainName,
IPAddress,
OSInfo,
OSArchitecture,
ClientVersion,
ComputerRole,
LastSyncTime,
LastReportedStatusTime,
@{ Name = 'Groups'; Expression = {
# Handles array or single string
$g = $_.RequestedTargetGroupNames
if ($g -is [System.Array]) { $g -join ', ' } else { [string]$g }
}
} |
Export-Csv -Path $out -NoTypeInformation -Encoding UTF8
Write-Host "Exported to $out"
Quick filters
- Stale clients (no sync for 14+ days)
Get-WSUSComputer | Where-Object { $_.LastSyncTime -lt (Get-Date).AddDays(-14) } | Select FullDomainName, LastSyncTime - Only servers
Get-WSUSComputer | Where-Object { $_.ComputerRole -eq 'Server' } | Select FullDomainName, OSInfo - By group (e.g., Global2)
Get-WSUSComputer | Where-Object { ($_.RequestedTargetGroupNames -is [array] -and $_.RequestedTargetGroupNames -contains 'Global2') -or ($_.RequestedTargetGroupNames -eq 'Global2') } | Select FullDomainName, RequestedTargetGroupNames
Summary: count by group
Expands multi-group memberships, then counts per group.
Get-WSUSComputer |
ForEach-Object {
$g = $_.RequestedTargetGroupNames
if ($g -is [array]) { $g } elseif ($g) { ,$g } else { @() } |
ForEach-Object { [pscustomobject]@{ Group = $_ } }
} |
Group-Object Group |
Sort-Object Count -Descending |
Select-Object Name, Count
JSON export (for dashboards)
$json = Get-WSUSComputer |
Select-Object FullDomainName,IPAddress,OSInfo,ClientVersion,RequestedTargetGroupNames |
ConvertTo-Json -Depth 4
$json | Out-File -FilePath "$env:USERPROFILE\Downloads\WSUS_Computers.json" -Encoding UTF8
Available attributes
Id, FullDomainName, IPAddress, Make, Model, BiosInfo, OSInfo, OSArchitecture, ClientVersion, OSFamily, OSDescription, ComputerRole, LastSyncTime, LastSyncResult, LastReportedStatusTime, LastReportedInventoryTime, RequestedTargetGroupName(s), ComputerTargetGroupIds, ParentServerId, SyncsFromDownstreamServer.
