text based tool for ldap queries

6,171

The command you're looking for is called ldapsearch. It's a bit of a pain to use, though. Here are some usage examples:

  • To get a full listing of all entries in the directory (depending on whether your server and/or network can handle this query):
ldapsearch -h ldapserver.example.cm -b "dc=example,dc=com" -s sub "objectclass=*"
  • To search for a particular user:
ldapsearch -h ldapserver.example.com -b "dc=example,dc=com" "cn=babs jensen"

You can find lots of examples if you do a web search for "ldapsearch examples"; there'll be something you can adapt to your own use.

Share:
6,171

Related videos on Youtube

Gunslinger
Author by

Gunslinger

Updated on September 18, 2022

Comments

  • Gunslinger
    Gunslinger almost 2 years

    I need a way to do LDAP queries through a text based interface. I use jXplorer on my own machine but that is a graphical client. Btw, I'm running Ubuntu server 14.04.

    The background:

    A server in my environment have trouble synchronizing a user database for a system it is running. The hostname is correct, it resolves to the correct IP, I can do a connection test but when I try to do a user query it fails with an error "no route to host". So I need a way to test this query command line.