GetAccessGroup
Gets a user group assigned to this computer given a specific role.
Syntax
IMzRoleAssignment GetAccessGroup(IRole role, DirectoryEntry group)
IMzRoleAssignment GetAccessGroup(IRole role, SearchResult groupSr)
IMzRoleAssignment GetAccessGroup(IRole role, string groupDn)
IMzRoleAssignment GetAccessGroup(IRole role, IADsGroup groupIAds)
Parameters
Specify the following parameter when using this method:
Parameter | Description |
role |
The role of the group. |
Specify one of the following parameters when using this method.
Parameter | Description |
group |
The directory entry for the group. |
groupSr |
The directory entry for the group specified as a search result. |
groupDn |
The group specified as a distinguished name. |
groupIads |
The IADs interface to the group. |
Return value
The computer role assignment that includes the specified group (IMzRoleAssignment.TrusteeType==Group).
Discussion
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 groupDE) and GetAccessGroup(IRole role, SearchResult groupSr) methods are available only for .NET-based programs. Call GetRoleAssignmentfor VBScript.
Exceptions
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.
Example
The HierarchicalZoneComputer.GetAccessGroup method is used in the same way as the HierarchicalZone.GetAccessGroup method. See AddAccessGroup for an example of using the HierarchicalZone.GetAccessGroup method in a script: