Using PowerShell to Output WSUS Group information

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)" 
} 

 

Using PowerShell to Output WSUS Group information

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 

Leave a Reply

Your email address will not be published. Required fields are marked *