Le 06/11/2019 à 19:00, Marian Thieme a écrit : > Hello, > > in the tutorial: > there is mentioned the some javascript in order to fetch the users in > the destination directory. I am trying to get this code adapted to my > needs. I have question regarding the line: > var destDn = ldap.search("ou=users,ou=demo", "(sAMAccountName=" + uid > + ")"); > How is the search function specified? What are the arguments? > RIght now I've organized users in the destination dir (AD) like this: > dc: CN=User Name,OU=People,DC=example,DC=org ... objectClass: person > cn: User Name sAMAccountName=marian.thieme uid=u12345 ... > I tried to lookup users in the AD like this: ldap.search("ou=people", > "(uid=" + uid + ")"); > But I am unsure about the 2 arguments I've to provide to ldap.search() > I can see from DEBUG logs that e.g. user dn: > uid=u12345,ou=people,dc=ldap,dc=example,dc=net does exist in the > source directory. > Since I have uid in the destination dir as well, I asume I can use the > uid to lookup the user. > However, a valid ldap query to retrieve the user "CN=User Name" with > uid u12345 from AD would be something like: ldapsearch -b > ou=people,$OBJECT_DN "(&(objectclass=person)(uid=u12345))"
Hello, you can find some information here: https://lsc-project.org/javadoc/2.1-SNAPSHOT/org/lsc/jndi/ScriptableJndiServices.html Note that search method returns an array, you have to take the first element to get the DN. And the value of the base parameter is concatened to the context set un LDAP URL at the connection level, so remove the context of the base value to avoid an error. -- Clément Oudot | Identity Solutions Manager clement.ou...@worteks.com Worteks | https://www.worteks.com
_______________________________________________________________ Ldap Synchronization Connector (LSC) - http://lsc-project.org lsc-users mailing list lsc-users@lists.lsc-project.org https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users