ADLib.ActiveDirectory.IsInGroup C# (CSharp) Метод

IsInGroup() публичный Метод

Returns true if the user is in the specified group
public IsInGroup ( System.DirectoryServices.AccountManagement.UserPrincipal adUser, string groupName ) : bool
adUser System.DirectoryServices.AccountManagement.UserPrincipal The user
groupName string The ID of the group to check for membership
Результат bool
        public bool IsInGroup(UserPrincipal adUser, string groupName)
        {
            GroupPrincipal g = GroupPrincipal.FindByIdentity(Context, groupName);
            return adUser.IsMemberOf(g);
        }