Search code examples
ldapopenldapopendjforgerock

ForgeRock Directory Server(OpenDj) ldapsearch in windows cmd ( not Linux)


If I want to search an LDAP entry from a LDAP server using ForgeRock Directory Server(OpenDJ), the document says in Linux it works like the following.

$ ldapsearch \
 --hostname localhost \
--port 1389 \
--baseDn dc=example,dc=com \
"(cn=Abagail Abadines)" \
 cn mail street l

If I want to run this command in Windows, it doesn't seem to work. What do I need to change in this command to run it on Windows's cmd.


Solution

  • It works the same, you just need to use ldapsearch.bat, and use the Windows continuation character (^) instead of \, or put all arguments on a single line.

    Also, when reading the documentation, the upper right corner icon allows you to copy the example command to your clipboard.