private static ADUserInformationCollection GetInformation(ADUserInformationCollection usersInfo, StringBuilder filter)
        {
            if (usersInfo.Count == 0)
            {
                return(null);
            }
            if (usersInfo.Count > 1)
            {
                filter.Insert(0, "|");
            }

            using (var searcher = new DirectorySearcher(String.Format(@"(&(objectClass=user)({0}))", filter))) {
                var searchResults = searcher.FindAll();
                foreach (SearchResult searchResult in searchResults)
                {
                    var info = GetInformationBySearchResult(searchResult);
                    if (info == null)
                    {
                        continue;
                    }
                    usersInfo[info.Login] = info;
                }
            }
            return(usersInfo);
        }
        public static ADUserInformationCollection GetPartialUsersInformation(IEnumerable <string> logins)
        {
            var result = new ADUserInformationCollection();

            result.AddRange(logins.Select(user => new ADUserInformation {
                Login = user
            }));
#if DEBUG
            return(result);
#endif
            try {
                var filter = new StringBuilder();
                foreach (var login in logins)
                {
                    filter.Append("(sAMAccountName=" + login + ")");
                }
                return(GetInformation(result, filter));
            }
            catch (Exception ex) {
                log.Error(String.Format("Не смогли получить информацию о пользователе AD. Admin={0}, Users=({1})",
                                        SecurityContext.Administrator.UserName, logins.Implode()), ex);
            }
            return(result);
        }