Compartir a través de


IUpdateServer.CreateComputerTargetGroup Method (String)

 

Applies To: Windows Server Update Services

Creates a target group to target client computers for updates.

Namespace:   Microsoft.UpdateServices.Administration
Assembly:  Microsoft.UpdateServices.Administration (in Microsoft.UpdateServices.Administration.dll)

Syntax

IComputerTargetGroup CreateComputerTargetGroup(
    string name
)
IComputerTargetGroup^ CreateComputerTargetGroup(
    String^ name
)
abstract CreateComputerTargetGroup : 
        name:string -> IComputerTargetGroup
Function CreateComputerTargetGroup (
    name As String
) As IComputerTargetGroup

Parameters

  • name
    Type: System.String

    Name of the target group to create. For example, Accounting or Manufacturing. The name must be unique, less than 256 characters, and cannot include the following characters: ~!@#$^&*()=+[]\{}|;:’”<>/.

Return Value

Type: Microsoft.UpdateServices.Administration.IComputerTargetGroup

An IComputerTargetGroup whose methods and properties you use to manage the group, for example, to add clients to the group.

Exceptions

Exception

Condition

WsusObjectAlreadyExistsException

name already exists. The group name must be unique.

ArgumentNullException

name cannot be null.

ArgumentOutOfRangeException

name cannot be empty or too long.

ArgumentException

name contains characters that are not valid.

InvalidOperationException

Unable to return the newly created IComputerTargetGroup. For example, you cannot create a computer target group if the server is a replica WSUS server (if IsReplicaServer is true).

Remarks

You use target groups to logically group and manage client computers on the server. By default, there are two groups, All Computers and Unassigned Computers. All clients belong to the All Computers group. A client can also belong to one other group.

If TargetingMode is Server, you can use AddComputerTarget to add clients to the group. Otherwise, clients can add themselves to the group.

See Also

CreateComputerTargetGroup Overload
IUpdateServer Interface
Microsoft.UpdateServices.Administration Namespace

Return to top