上QQ阅读APP看书,第一时间看更新
How to do it...
The steps for the recipe are as follows:
- Create a WSUS computer target group for the Domain Controllers:
$WSUSServer = Get-WsusServer
$WSUSServer.CreateComputerTargetGroup('Domain Controllers')
- Add a computer to the new computer target group:
Get-WsusComputer -NameIncludes DC1 |
Add-WsusComputer -TargetGroupName 'Domain Controllers'
- List the clients in the computer target group:
$DCGroup = $WSUSServer.GetComputerTargetGroups() |
Where-Object -Property Name -eq 'Domain Controllers'
Get-WsusComputer |
Where-Object -Property ComputerTargetGroupIDs
-Contains $DCGroup.Id