none
[LDAP] searchrequest

    Discussion générale

  • Bonjour,

    Suite à la connexion réussie au serveur LDAP, je n'arrive pas à filtrer les "sn":

    LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier("xxx.xx.xxx.x", 636)); connection.SessionOptions.ProtocolVersion = 3; connection.AuthType = AuthType.Basic; connection.Credential = new System.Net.NetworkCredential("uid=user,OU=people,DC=domain,DC=fr", "passw"); connection.SessionOptions.SecureSocketLayer = true; connection.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback((con, cer) => true); connection.Bind();//Connexion réussie

    string baseDN = "DC=domain,DC=fr"; string filter = "(&(objectCategory=person)(objectClass=user)(sn=" + montexte + "*))"; string[] attribs = { "samaccountname", "displayname", "sn" }; SearchRequest searchRequest = new SearchRequest(baseDN, filter, System.DirectoryServices.Protocols.SearchScope.Subtree, attribs); SearchResponse response = (SearchResponse)connection.SendRequest(searchRequest); MessageBox.Show(response.Entries.Count.ToString())

    Entries.Count=0 (en réalité 20)

    Que se passe t'il?

    D'avance merci.


    mercredi 28 février 2018 14:39

Toutes les réponses