Add-Wsus
Computer
Syntax
Add-WsusComputer
-Computer <WsusComputer>
-TargetGroupName <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-WsusComputer cmdlet adds the specified computer to the specified target group on the local server or a specified server. You can invoke this command by using the pipeline operator for the results of the Get-WsusComputer cmdlet. Calling the Get-WsusComputer cmdlet and passing the results into this cmdlet enables you to leverage the filtering capabilities of the Get-WsusComputer cmdlet in moving the desired computers to the specified target group. The server used in the Get-WsusComputer cmdlet is also used in this cmdlet.
Examples
Example 1: Add computers to a target group
PS C:\> Get-WsusServer -Name "contoso" | Get-WsusComputer -NameIncludes "winvm" | Add-WsusComputer -TargetGroupName "Windows Virtual Machines"
This command adds all computers with winvm in the name to the target group named Windows Virtual Machines on the server named contoso.
Required Parameters
Specifies the object that contains the client computer to be added. This value is obtained by running the Get-WsusComputer cmdlet and piping the resulting WsusComputer object into this cmdlet.
Type: | WsusComputer |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Specifies the name of the computer target group for which to run this cmdlet.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Optional Parameters
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.UpdateServices.Commands.WsusComputer
Outputs
None