LDAP, DirectoryServices c# search base for queries -


i'm trying use ldap server has client login apparently has simple bind (with distinguished name).

var cliententry = new directoryentry( "ldap://server.de", "cn=medialibrary, ou=special users, dc=uni, dc=de", "password", authenticationtypes.none);  directorysearcher directorysearch = new directorysearcher(cliententry, "(cn=searchuser");  searchresult result = directorysearch.findone(); 

the connection via dn works fine. search cn=searchuser returns no users (and no errors).

the user trying search in path:

ou=people,dc=uni,dc=de

in ldap-admin utility can log in using cn=medialibrary etc dn , if modify search base "ou=people,dc=uni-potsdam,dc=de" , search find cn=searchuser entry

the question equivilent modifying search base can in utility in c# code?

(the target user in different branch default branch given directory entry must bind to.)

i believe original directory url has been tried , did not work (permissions?)

ldap://server.de/ou=people,dc=uni,dc=de

string ldappath = "dc=uni,dc=de" string filter = "(cn=searchuser)" string username = "medialibrary" string password = "password" directoryentry startingpoint = new directoryentry("ldap://"+ldappath, username, password); directorysearcher searcher = new directorysearcher(startingpoint); searcher.filter = filter; 

from there can searcher.findone , use value need. let me know if works.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -