Principal.IsMemberOf Method (PrincipalContext, IdentityType, String)
Returns a Boolean value that specifies whether the principal is a member of the group specified by identity type and value.
Assembly: System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)
<SecurityCriticalAttribute> Public Function IsMemberOf ( context As PrincipalContext, identityType As IdentityType, identityValue As String ) As Boolean
The PrincipalContext that specifies the server or domain against which operations are performed.
A IdentityType enumeration value that specifies the type of the identity value.
The identity of the group.
Return ValueType: System.Boolean
true if the principal is a member of the specified group; otherwise false.
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.
Available since 3.5