GetRoleAssignment

Returns the user role assignment for a specified role and user.

Syntax

IRoleAssignment GetRoleAssignment(IRole role, string dn)

Parameters

Specify the following parameters when using this method.

Parameter Description
role The role for which you want a role assignment.
dn The distinguished name of the user for which you want a role assignment.

Return value

The role assignment for the specified role and user.

Discussion

Any number of users can be assigned to a computer role and each of those users can have more than one role. Use this method to get the user role assignment for a specific user and role. To get the computer role assignment for a specific user, call the GetUser method.

Exceptions

GetRoleAssignment throws an ArgumentNullException if one of the specified parameter values is null.