Skip to content

FindIdentity

Retrieves an identity based on the specified path and type.

1
$Membership.FindIdentity(path: string, type: IdentityType):Identity

Parameters

string path
    The path of the identity to find. The format of the path depends on the identity type.

IdentityType type
    The type of identity to search for. If not specified, defaults to "User".

Returns

The identity matching the specified path and type, or null if no match is found.

Remarks

The path and type arguments should correspond to one of the following:
- User: The logon ID of the user (e.g., "John.doe").
- Group: The name of the group (e.g., "Developers").
- OrganizationUnit: The qualified path of the organization unit (e.g., "General Management\Accounting").

Finding a User:

1
var user = $Membership.FindIdentity('elton.john');

Finding a Group:

1
var group = $Membership.FindIdentity('Developers','Group');

Info

When specifying an organization unit path, either "\" or "/" can be used as separators.

Finding an Organization Unit:

1
var orgUnit = $Membership.FindIdentity('General Management\\Accounting','OrganizationUnit');

Types

IdentityType

Defines the possible types of identities in the system.

( "User" | "OrganizationUnit" | "Position" | "Group" )

See Also