Principal.IsMemberOf Principal.IsMemberOf Principal.IsMemberOf Principal.IsMemberOf Method

Definition

Returns a Boolean value that specifies whether the group is a member of the specified group.

Overloads

IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String)

Returns a Boolean value that specifies whether the principal is a member of the group specified by identity type and value.

IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal)

Returns a Boolean value that specifies whether the principal is a member of the specified group.

IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String)

Returns a Boolean value that specifies whether the principal is a member of the group specified by identity type and value.

public:
 bool IsMemberOf(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::DirectoryServices::AccountManagement::IdentityType identityType, System::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

Parameters

context
PrincipalContext PrincipalContext PrincipalContext PrincipalContext

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

identityType
IdentityType IdentityType IdentityType IdentityType

A IdentityType enumeration value that specifies the type of the identity value.

identityValue
String String String String

The identity of the group.

Returns

true if the principal is a member of the specified group; otherwise false.

Exceptions

Remarks

If the current principal is an AD DS principal, the returned groups include the principal's primary group, as indicated by the primary group ID attribute on the AD DS object.

IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal)

Returns a Boolean value that specifies whether the principal is a member of the specified 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
Public Function IsMemberOf (group As GroupPrincipal) As Boolean

Parameters

group
GroupPrincipal GroupPrincipal GroupPrincipal GroupPrincipal

The GroupPrincipal object for which principal membership is determined.

Returns

true if the principal is a member of the specified group; otherwise false.

Exceptions

Remarks

If the current principal is an AD DS principal, the returned groups include the principal's primary group, as indicated by the primary group ID attribute on the AD DS object.

Applies to