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


IHzRoleAssignment GetAccessGroup(IRole role, DirectoryEntry group)
IHzRoleAssignment GetAccessGroup(IRole role, SearchResult groupSr)
IHzRoleAssignment GetAccessGroup(IRole role, string groupDn)
IHzRoleAssignment 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 the 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 (IHzRoleAssignment.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 GetRoleAssignmentfor 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 user; or if it failed to create a role assignment because it cannot find the user.


See AddAccessGroup for an example of using the GetAccessGroup method in a script: