Principal.IsMemberOf 方法

定義

傳回布林值,這個值指定群組是否為所指定群組的成員。

多載

IsMemberOf(PrincipalContext, IdentityType, String)

傳回布林值,這個值指定主體是否為識別型別和值所指定之群組的成員。

IsMemberOf(GroupPrincipal)

傳回布林值,這個值指定主體是否為所指定群組的成員。

IsMemberOf(PrincipalContext, IdentityType, String)

來源:
Principal.cs
來源:
Principal.cs
來源:
Principal.cs

傳回布林值,這個值指定主體是否為識別型別和值所指定之群組的成員。

public:
 bool IsMemberOf(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::DirectoryServices::AccountManagement::IdentityType identityType, System::String ^ identityValue);
public bool IsMemberOf (System.DirectoryServices.AccountManagement.PrincipalContext context, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue);
[System.Security.SecurityCritical]
public bool IsMemberOf (System.DirectoryServices.AccountManagement.PrincipalContext context, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue);
member this.IsMemberOf : System.DirectoryServices.AccountManagement.PrincipalContext * System.DirectoryServices.AccountManagement.IdentityType * string -> bool
[<System.Security.SecurityCritical>]
member this.IsMemberOf : System.DirectoryServices.AccountManagement.PrincipalContext * System.DirectoryServices.AccountManagement.IdentityType * string -> bool
Public Function IsMemberOf (context As PrincipalContext, identityType As IdentityType, identityValue As String) As Boolean

參數

context
PrincipalContext

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

identityType
IdentityType

IdentityType 列舉值,指定識別值的型別。

identityValue
String

群組的識別。

傳回

如果主體是所指定群組的成員則為 true,否則為 false

屬性

例外狀況

識別型別或值未對應至 GroupPrincipal

找到一個以上符合的 GroupPrincipal

備註

如果目前的主體是 AD DS 主體,則傳回的群組會包含主體的主要群組,如 AD DS 物件上的主要群組標識符屬性所表示。

適用於

IsMemberOf(GroupPrincipal)

來源:
Principal.cs
來源:
Principal.cs
來源:
Principal.cs

傳回布林值,這個值指定主體是否為所指定群組的成員。

public:
 bool IsMemberOf(System::DirectoryServices::AccountManagement::GroupPrincipal ^ group);
public bool IsMemberOf (System.DirectoryServices.AccountManagement.GroupPrincipal group);
[System.Security.SecurityCritical]
public bool IsMemberOf (System.DirectoryServices.AccountManagement.GroupPrincipal group);
member this.IsMemberOf : System.DirectoryServices.AccountManagement.GroupPrincipal -> bool
[<System.Security.SecurityCritical>]
member this.IsMemberOf : System.DirectoryServices.AccountManagement.GroupPrincipal -> bool
Public Function IsMemberOf (group As GroupPrincipal) As Boolean

參數

group
GroupPrincipal

判斷其主體成員資格的 GroupPrincipal 物件。

傳回

如果主體是所指定群組的成員則為 true,否則為 false

屬性

例外狀況

找不到群組參數中指定的 GroupPrincipal

找到一個以上符合的 GroupPrincipal

備註

如果目前的主體是 AD DS 主體,則傳回的群組會包含主體的主要群組,如 AD DS 物件上的主要群組標識符屬性所表示。

適用於