Gets a user group assigned to this computer role given a specific role.


IAzRoleAssignment GetAccessGroup(IRole role, DirectoryEntry group)
IAzRoleAssignment GetAccessGroup(IRole role, SearchResult groupSr)
IAzRoleAssignment GetAccessGroup(IRole role, string groupDn)
IAzRoleAssignment GetAccessGroup(IRole role, IADsGroup groupIAds)


Specify the following parameter when using this method:

Parameter Description


The role of the group.

Specify one of the following parameters when using this method.

Parameter Description


The directory entry for the group.


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


The group specified as a distinguished name.


The IADs interface to the group.

Return value

The computer role assignment that includes the specified group (IAzRoleAssignment.TrusteeType==Group).


Any number of user groups can be assigned to a computer role and each of those groups can have more than one role. Use this method to get the computer role assignment for a specific group and role.

The GetAccessGroup(IRole role, DirectoryEntry group) and GetAccessGroup(IRole role, SearchResult groupSr) methods are available only for .NET-based programs; call AddRoleAssignmentfor VBScript.


GetAccessGroup 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 get a role assignment because it cannot find the group.