ComputerPrincipal.FindByIdentity 方法

定義

傳回符合指定的識別值之電腦主體物件。

多載

FindByIdentity(PrincipalContext, String)

傳回符合指定的識別值之電腦主體物件。

FindByIdentity(PrincipalContext, IdentityType, String)

傳回符合指定之識別型別和值的電腦主體物件。 這一版的 FindByIdentity 方法會判斷身分識別值的格式。

FindByIdentity(PrincipalContext, String)

來源:
Computer.cs
來源:
Computer.cs
來源:
Computer.cs

傳回符合指定的識別值之電腦主體物件。

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

參數

context
PrincipalContext

針對執行的作業指定伺服器或網域的 PrincipalContext

identityValue
String

電腦的識別 (Identity)。 這個參數可以是 IdentityType 列舉中包含的任何格式。

傳回

符合指定的身分識別值的 ComputerPrincipal 物件,如果找不到相符項目則為 null。

例外狀況

找到多個符合目前電腦物件的電腦主體物件。

適用於

FindByIdentity(PrincipalContext, IdentityType, String)

來源:
Computer.cs
來源:
Computer.cs
來源:
Computer.cs

傳回符合指定之識別型別和值的電腦主體物件。 這一版的 FindByIdentity 方法會判斷身分識別值的格式。

public:
 static System::DirectoryServices::AccountManagement::ComputerPrincipal ^ FindByIdentity(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::DirectoryServices::AccountManagement::IdentityType identityType, System::String ^ identityValue);
public static System.DirectoryServices.AccountManagement.ComputerPrincipal 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.ComputerPrincipal
Public Shared Function FindByIdentity (context As PrincipalContext, identityType As IdentityType, identityValue As String) As ComputerPrincipal

參數

context
PrincipalContext

針對執行的作業指定伺服器或網域的 PrincipalContext

identityType
IdentityType

指定 identityValue 參數格式的 IdentityType 列舉值。

identityValue
String

電腦的識別 (Identity)。 這個參數可以是 IdentityType 列舉中包含的任何格式。

傳回

符合指定的身分識別值和類型的 ComputerPrincipal 物件,如果找不到相符項目則為 null。

例外狀況

找到多個符合目前電腦物件的電腦主體物件。

身分識別值不是有效的 IdentityType 列舉值。

適用於