AddAccessGroup

Adds a user group to this computer role.

Syntax

IAzRoleAssignment AddAccessGroup(DirectoryEntry group)
IAzRoleAssignment AddAccessGroup(SearchResult groupSr)
IAzRoleAssignment AddAccessGroup(string groupDn)
IAzRoleAssignment AddAccessGroup(IADsGroup groupIads)

Parameters

Specify one of the following parameters when using this method.

Parameter Description

group

The directory entry for the group you want to add.

groupSr

The directory entry for a group specified as a search result.

groupDn

The group specified as a distinguished name.

groupIads

The IADs interface to the group.

Discussion

The AddAccessGroup(DirectoryEntry group) and AddAccessGroup(SearchResult group) methods are available only for .NET-based programs; call AddRoleAssignmentfor VBScript.

Return value

The computer role assignment that includes the new group.

Exceptions

AddAccessGroup may throw one of the following exceptions:

  • ArgumentNullException if the specified parameter value is null.
  • ApplicationException if the parameter value is not a valid group or if it failed to create a role assignment because it cannot find the group.