Edit

Share via


Add-WsusComputer

Adds a client computer to a target group.

Syntax

Default (Default)

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.

Parameters

-Computer

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.

Parameter properties

Type:WsusComputer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetGroupName

Specifies the name of the computer target group for which to run this cmdlet.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.UpdateServices.Commands.WsusComputer

Outputs

Object