IUpdateServer.CreateComputerTargetGroup(String)
Creates a target group that you use to target client computers for updates.
public IComputerTargetGroup CreateComputerTargetGroup(
String name
);
Public Function CreateComputerTargetGroup( _
ByVal name As String _
) As IComputerTargetGroup
Implements IUpdateServer.CreateComputerTargetGroup
Parameters
- name
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 Values
An IComputerTargetGroup whose methods and properties you use to manage the group, for example, to add clients to the group.
Exceptions
Exception type | Condition |
---|---|
WsusObjectAlreadyExistsException | The name already exists. The group name must be unique. |
System.ArgumentNullException | The name cannot be null. |
System.ArgumentOutOfRangeException | The name cannot be empty or the name is too long. |
System.ArgumentException | The name contains characters that are not valid. |
System.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 IUpdateServerConfiguration.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 IUpdateServerConfiguration.TargetingMode is TargetingMode.Server, you can use IComputerTargetGroup.AddComputerTarget to add clients to the group. Otherwise, clients can add themselves to the group.
Requirements
Server | Requires Windows Server 2003 or Windows 2000 Server SP4 and later. |
Namespace | Defined in Microsoft.UpdateServices.Administration. |
Assembly | Requires Microsoft.UpdateServices.Administration (in Microsoft.UpdateServices.Administration.dll). |
.NET Framework | Requires .NET Framework 1.1. |
See Also
IComputerTargetGroup, IUpdateServer.GetComputerTargetGroup, ComputerTargetGroupCollection.Remove