Problem:
How do you retrieve information on WSUS Groups and group member via PowerShell?
Solution:
The below script will output all groups and how many members are in each group
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer() foreach( $group in $wsus.GetComputerTargetGroups() ) { Write-Host "Group: " $group.Name " - " $group.GetComputerTargets().Count " member(s)" }
Run the below to get an output of all the members of a particular group:
$wsus.GetComputerTargetGroups() $mygroup = $wsus.GetComputerTargetGroups() | ? {$_.Name -eq "critical"} $mygroup.GetComputerTargets() | select FullDomainName | export-csv c:\temp\critical.csv