GetRoleAssignmentsFromDomain

Returns the collection of all role assignments associated with a user in a specified domain.

Syntax

IRoleAssignments GetRoleAssignmentsFromDomain(string domain)

Parameters

Specify the following parameter when using this method:

Parameter Description

domain

The domain to search for the user’s role assignments.

Return value

A collection of role assignment objects representing all of the role assignments explicitly assigned to this user in the specified domain or in the currently joined domain.

Discussion

This method only returns the role assignments that have been explicitly assigned to the user. The method will look for stored credentials to access the specified domain. If there are no stored credentials, the method uses the default credentials for the current user.

If you don’t specify a domain by passing an empty string ("") to the method, the method returns role assignments from the currently joined domain.

Example

The following code sample illustrates using GetRoleAssignmentsFromDomain in a script:

...
# New Cims object
$cims = New-Object ("Centrify.DirectControl.API.Cims");
# Get IUser object
$objUserDn = "CN=user1,CN=Users,DC=domain,DC=com";
$objUser = $cims.GetUser($objUserDn);
# Get role assignments from domain
$objUser.GetRoleAssignmentsFromDomain("domain.com")
...