Я пытаюсь выполнить поиск LDAP, но получаю следующую ошибку:
Unhandled Exception: System.Runtime.InteropServices.COMException (0x80072024): T
he administrative limit for this request was exceeded.
at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext
()
at System.DirectoryServices.DirectorySearcher.FindOne()
Вот код: (Ошибка выдается в FindOne ())
DirectoryEntry dirEntry = new DirectoryEntry("LDAP://myldap.com:1701/ou=People,o=My Company,c=CA", "", "", AuthenticationTypes.Anonymous);
DirectorySearcher dirSearcher = new DirectorySearcher(dirEntry);
string filter = "mail";
string filterValue = "my.email@mycompany.com";
dirSearcher.Filter = string.Format("({0}={1})", filter, filterValue);
SortOption sortOption = new SortOption(filter, SortDirection.Ascending);
dirSearcher.Sort = sortOption;
dirSearcher.PropertiesToLoad.Add("uid");
dirSearcher.SearchScope = SearchScope.Subtree;
SearchResult result = dirSearcher.FindOne();
DirectoryEntry directEntry = result.GetDirectoryEntry();
Console.WriteLine("Result: {0}", directEntry.Properties["uid"].Value.ToString());
Есть идеи как обойти это?