public List <LdapObject> FindUsersByAttribute(string key, IEnumerable <string> value, StringComparison comparison = StringComparison.InvariantCultureIgnoreCase) { var users = new List <LdapObject>(); if (!AllDomainUsers.Any() && !TryLoadLDAPUsers()) { return(users); } return(AllDomainUsers.Where(us => !us.IsDisabled && value.Any(val => string.Equals(val, (string)us.GetValue(key), comparison))).ToList()); }
private List <LdapObject> FindUsersByPrimaryGroup() { if (!AllDomainUsers.Any() && !TryLoadLDAPUsers()) { return(null); } return (AllDomainUsers.Where( lu => { var primaryGroupId = lu.GetValue(LdapConstants.ADSchemaAttributes.PRIMARY_GROUP_ID) as string; return !string.IsNullOrEmpty(primaryGroupId) && primaryGroupId.Equals(PrimaryGroupId, StringComparison.InvariantCultureIgnoreCase); }) .ToList()); }
private List <LdapObject> FindUsersByPrimaryGroup(string sid) { _log.Debug("LdapUserImporter.FindUsersByPrimaryGroup()"); if (!AllDomainUsers.Any() && !TryLoadLDAPUsers()) { return(null); } return (AllDomainUsers.Where( lu => { var primaryGroupId = lu.GetValue(LdapConstants.ADSchemaAttributes.PRIMARY_GROUP_ID) as string; return !string.IsNullOrEmpty(primaryGroupId) && sid.EndsWith(primaryGroupId); }) .ToList()); }