ComputerPrincipal.FindByIdentity Method (PrincipalContext, String)

 

Returns a computer principal object that matches the specified identity value.

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

public static ComputerPrincipal FindByIdentity(
	PrincipalContext context,
	string identityValue
)

Parameters

context
Type: System.DirectoryServices.AccountManagement.PrincipalContext

The T:System.DirectoryService.AccountManagement.PrincipalContext that specifies the server or domain against which operations are performed.

identityValue
Type: System.String

The identity of the computer. This parameter can be any format that is contained in the T:System.DirectoryService.AccountManagement.IdentityType enumeration.

Return Value

Type: System.DirectoryServices.AccountManagement.ComputerPrincipal

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

Exception Condition
T:System.MultipleMatchesException

Multiple computer principal objects matching the current computer object were found.

.NET Framework
Available since 3.5
Return to top
Show: