The ldap-utils package includes a number of utilities that can be used to perform operations on a LDAP server. All tools are based on OpenLDAP software an open source implementation of the Lightweight Directory Access Protocol.

The package contains the following tools (https://wiki.debian.org/LDAP/LDAPUtils):
ldapsearch – search for and display entries
ldapmodify – modify an entry
ldapadd – add a new entry
ldapdelete – remove and entry
ldapmodrdn – rename an entry
ldappasswd – change the password for an entry
ldapwhoami – display with which entry I am bound to the server
ldapcompare – compare a field in the entry to some value
Examples:
ldapsearch -LLL -H "ldap://localhost:port" -D "CN=LDAP Service Account,OU=ServiceAccoun ts,DC=domain,DC=local" -y ./pwd -b "CN=Computers,DC=domain,DC=local" "cn=hostname" dn operatingsystem
-LLL
Search results are displayed in LDAP Data Interchange Format. A single -L restricts the output to LDIFv1
A second -L disables comments. A third -L disables printing of the LDIF version. The default is to use an extended version of LDIF
-H
Specify URI(s) referring to the ldap server(s).
-D
Use the Distinguished Name of an account to bind to the LDAP directory
-y
Use the content of a password file instead of specifying the password on the CLI
-b
Use a custom base DN as a starting point for the query