Principal.FindByIdentity Principal.FindByIdentity Principal.FindByIdentity Principal.FindByIdentity Method

Definition

Returns a principal object that matches the specified identity value.

Overloads

FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String)

Returns a principal object that matches the specified identity value.

FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String)

Returns a principal object that matches the specified identity type, and value. This version of the FindByIdentity(PrincipalContext, IdentityType, String) method determines the format of the identity value.

FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String)

Returns a principal object that matches the specified identity value.

public:
 static System::DirectoryServices::AccountManagement::Principal ^ FindByIdentity(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::String ^ identityValue);
[System.Security.SecurityCritical]
public static System.DirectoryServices.AccountManagement.Principal FindByIdentity (System.DirectoryServices.AccountManagement.PrincipalContext context, string identityValue);
static member FindByIdentity : System.DirectoryServices.AccountManagement.PrincipalContext * string -> System.DirectoryServices.AccountManagement.Principal
Public Shared Function FindByIdentity (context As PrincipalContext, identityValue As String) As Principal

Parameters

context
PrincipalContext PrincipalContext PrincipalContext PrincipalContext

The PrincipalContext that specifies the server or domain against which operations are performed.

identityValue
String String String String

The identity of the principal. This parameter can be any format that is contained in the IdentityType enumeration.

Returns

A Principal object that matches the specified identity value and type, or null if no matches are found.

Exceptions

Multiple principal objects matching the current object were found.

FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String)

Returns a principal object that matches the specified identity type, and value. This version of the FindByIdentity(PrincipalContext, IdentityType, String) method determines the format of the identity value.

public:
 static System::DirectoryServices::AccountManagement::Principal ^ FindByIdentity(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::DirectoryServices::AccountManagement::IdentityType identityType, System::String ^ identityValue);
[System.Security.SecurityCritical]
public static System.DirectoryServices.AccountManagement.Principal FindByIdentity (System.DirectoryServices.AccountManagement.PrincipalContext context, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue);
static member FindByIdentity : System.DirectoryServices.AccountManagement.PrincipalContext * System.DirectoryServices.AccountManagement.IdentityType * string -> System.DirectoryServices.AccountManagement.Principal

Parameters

context
PrincipalContext PrincipalContext PrincipalContext PrincipalContext

The PrincipalContext that specifies the server or domain against which operations are performed.

identityType
IdentityType IdentityType IdentityType IdentityType

An IdentityType enumeration value that specifies the format of the identityValue parameter.

identityValue
String String String String

The identity of the principal. This parameter can be any format that is contained in the IdentityType enumeration.

Returns

A Principal object that matches the specified identity value and type or null if no matches are found.

Exceptions

Multiple principal objects matching the current object were found.

Applies to