Add-WsusComputer

Adds a specified client computer, that is already registered to a WSUS server, to a specified target group.

Syntax

Add-WsusComputer
   -Computer <WsusComputer>
   -TargetGroupName <String>
   [-Confirm]
   [-WhatIf]

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 Piping in the results of the Get-WsusComputer cmdlet. Calling the Get-WsusComputer cmdlet and piping 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 will also be used in this cmdlet.

Examples

EXAMPLE 1

PS C:\> Get-WsusServer contoso | Get-WsusComputer -NameIncludes winvm | Add-WsusComputer -TargetGroupName "Windows Virtual Machines"

This example adds all computers with winvm in the name to the target group named Windows Virtual Machines on the server named contoso.

Required 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.

Type:WsusComputer
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-TargetGroupName

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.UpdateServices.Commands.WsusComputer

WsusComputer

Outputs

None