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

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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
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
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

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

Inputs

Microsoft.UpdateServices.Commands.WsusComputer

WsusComputer

Outputs

None