Principal.FindByIdentity Method (PrincipalContext, String)

 

Returns a principal object that matches the specified identity value.

Namespace:   System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)

[SecurityCriticalAttribute]
public static Principal FindByIdentity(
	PrincipalContext context,
	string identityValue
)

Parameters

context
Type: System.DirectoryServices.AccountManagement.PrincipalContext

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

identityValue
Type: System.String

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

Return Value

Type: System.DirectoryServices.AccountManagement.Principal

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

Exception Condition
T:System.MultipleMatchesException

Multiple principal objects matching the current object were found.

.NET Framework
Available since 3.5

System.DirectoryServices.AccountManagement
FindByIdentity Overload
Principal Class
System.DirectoryServices.AccountManagement Namespace Overview

Return to top
Show: