Affecto.ActiveDirectoryService.Principal.IsActiveUser C# (CSharp) Method

IsActiveUser() private static method

private static IsActiveUser ( System.DirectoryServices.DirectoryEntry adUser ) : bool
adUser System.DirectoryServices.DirectoryEntry
return bool
        private static bool IsActiveUser(DirectoryEntry adUser)
        {
            if (adUser.NativeGuid == null)
            {
                return false;
            }

            int flags = (int)adUser.Properties[ActiveDirectoryProperties.UserAccountControl].Value;

            return !Convert.ToBoolean(flags & 0x0002);
        }
    }