Back to All Commands
Most Viewed
Favorites
Recently Viewed
ldap Commands
Search Operations
ldapsearch
Search for entries in an LDAP directory.
ldapsearch
Examples:
Basic searchldapsearch -H ldap://localhost:389 -b "dc=example,dc=com" "(objectClass=person)"
ldapsearch -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password -b "dc=example,dc=com" "(uid=john)"
ldapsearch -H ldap://localhost:389 -b "dc=example,dc=com" "(objectClass=person)" cn mail
Modify Operations
ldapadd
Add entries to an LDAP directory.
ldapadd
Examples:
Add entry from LDIF fileldapadd -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password -f entry.ldif
echo "dn: uid=john,ou=people,dc=example,dc=com\nobjectClass: person\nuid: john\ncn: John Doe" | ldapadd -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password
ldapdelete
Delete entries from an LDAP directory.
ldapdelete
Examples:
Delete entryldapdelete -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password "uid=john,ou=people,dc=example,dc=com"
ldapdelete -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password -r "ou=people,dc=example,dc=com"
Authentication
ldapwhoami
Perform a whoami operation against an LDAP server.
ldapwhoami
Examples:
Check current identityldapwhoami -H ldap://localhost:389 -D "cn=admin,dc=example,dc=com" -w password