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)

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

IsMemberOf(GroupPrincipal)

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

IsMemberOf(PrincipalContext, IdentityType, String)

Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs

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);
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

Parameters

context
PrincipalContext

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

identityType
IdentityType

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

identityValue
String

The identity of the group.

Returns

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

Attributes

Exceptions

The identity type or value does not correspond to a GroupPrincipal.

More than one matching GroupPrincipal was found.

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

IsMemberOf(GroupPrincipal)

Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs
Source:
Principal.cs

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

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

Parameters

group
GroupPrincipal

The GroupPrincipal object for which principal membership is determined.

Returns

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

Attributes

Exceptions

The GroupPrincipal specified in the group parameter could not be found.

More than one matching GroupPrincipal was found.

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