Je suis en train de faire une recherche LDAP mais je continue à obtenir l'erreur suivante:Limite administrative Dépassé Au cours de C# LDAP Recherche
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()
Voici le code: (L'erreur est levée à 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 = "[email protected]";
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());
Des idées pour contourner ce problème?
Est-ce LDAP contre Active Directory, ou contre un autre annuaire LDAP? Si autre: lequel ?? –
Oui Active Directory –
Le chemin LDAP semblait juste un peu étrange - je ne savais pas si AD prenait en charge des choses comme 'o =' et 'c =' - celles-ci étaient généralement utilisées dans OpenLDAP ou Novell eDirectory. –