Wednesday, 31 May 2017

LDAPjs find entry knowing cn

I have a remote LDAP server with entries like this:

CN=Fred Foobar, OU=Dept1, O=FooBar

Using LDAPjs as a client, how do I find this entry when only the CN is known at runtime?

I have tried each of the following, with no success:

ldap.search("cn=Fred Foobar", {}, callback); // returns an error
ldap.search("", {filter: "(cn=Fred Foobar)"}, callback); // returns nothing useful
ldap.search("", {filter: "(cn=Fred Foobar)", scope: "sub"}, callback); // returns an error



via user1207177

No comments:

Post a Comment