0

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.

Jin Lee
  • 3,194
  • 12
  • 46
  • 86

2 Answers2

2

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.

Ludovic Poitou
  • 4,788
  • 2
  • 21
  • 30
0

I figured it out after two hours of trying! I hope this might help someone. In Linux, \ means new line (of course, it also means escape sequence). It created new line. So in Window's cmd mode, just type the whole command without \

Also, even in Linux, typing the whole command without \ seem to work fine without any error. (By putting \ every line somehow didn't work in the middle. )

In Unix/Linux, Windows, and Mac, '/' (slash) and '\' ( backslash ) are confusing a little. So when executing commands or setting paths, gotta watch out.

Jin Lee
  • 3,194
  • 12
  • 46
  • 86