Using ldapsearch

Product documentation


Abstract

Lotus Domino provides a command-line search utility, ldapsearch.exe, that allows you to use Lightweight Directory Access Protocol (LDAP) to search entries in the Domino Directory on a server that runs the LDAP service or search entries in a third-party LDAP directory.

Content

For the most up-to-date information on ldapsearch, refer to the Domino Administrator help for your version of Notes/Domino from the Lotus Domino documentation page.

Included below for your convenience is an excerpt from the Domino 7 Administration Guide.


LDAPSEARCH

Domino provides a command-line search utility, ldapsearch.exe, that allows you to use LDAP to search entries in the Domino Directory on a server that runs the LDAP service or search entries in a third-party LDAP directory. ldapsearch connects to the server that you specify and returns results according to the search criteria.

ldapsearch is available on Domino server platforms and Notes® client platforms. To use ldapsearch, the NOTES.INI file must be included in your system's path statement.

To use Idapsearch:

Enter the following command from the Domino or Notes program directory:

ldapsearch parameters searchfilter attributes

Where:

  • are case-sensitive command-line parameters.
  • is a required search filter that causes ldapsearch to find only entries that meet specific attribute criteria.
  • attributes are optional attributes that limit the attributes that ldapsearch returns. Separate attributes with spaces. If you don't specify one or more attributes, ldapsearch returns all attributes.

Note that you do not have to enter the command on a machine that runs the Domino LDAP service.

Examples of using ldapsearch

To search for Use this command
All entries on host ldap.acme.com port 389, and return all attributes and values ldapsearch -h ldap.acme.com "objectClass=*"
Same as above, but just return attribute names ldapsearch -A -h ldap.acme.com"objectClass=*"
Same as above, but de-reference any aliases found ldapsearch -a always -h ldap.acme.com "objectClass=*"
Search for all entries on host ldap.acme.com port 389, and return attributes=dn,mail,cn,sn,gn ldapsearch -h ldap.acme.com "objectClass=*" dn mail cn sn givenname
Same as above, but return only attribute names ldapsearch -A -h ldap.acme.com "objectClass=*" dn mail cn sn givenname
Search for (cn=Mike*) under base "ou=West,o=Acme, c=US" on host ldap.acme.com port 389, and return all attributes and values ldapsearch -b "ou=West,o=Acme,c=US" -h ldap.acme.com "(cn=Mike*)"
Search one level on host ldap.acme.com port 389, and return all attributes and values ldapsearch -s onelevel -h ldap.acme.com "objectClass=*"
Same as above, but limit scope to base ldapsearch -s base -h ldap.acme.com "objectClass=*"
Search for all entries on host ldap.acme.com port 389; return all attributes and values; do not exceed the time limit of five seconds ldapsearch -l 5 -h ldap.acme.com "objectClass=*"
Search for all entries on host ldap.acme.com port 389; return all attributes and values; do not exceed the size limit of five ldapsearch -z 5 -h ldap.acme.com "objectClass=*"
Search for (cn=John Smith) on host ldap.acme.com using port 389, and return all attributes for that particular entry. ldapsearch -h ldap.acme.com cn="John Smith"
Search for (cn=John Smith) on host ldap.acme.com, port 389, using credentials (username and password) to access the LDAP directory and return all attributes for that particular entry. Credentials may be required if anonymous users are not allowed to query the LDAP directory. ldapsearch -h ldap.acme.com -D myusername -w mypassword cn="John Smith"

Cross Reference information
Segment Product Component Platform Version Edition
Organizational Productivity- Portals & Collaboration IBM Sametime Directory Services/LDAP AIX, i5/OS, IBM i, Linux, Solaris, Windows 8.5, 8.0, 7.5.1, 7.5, 6.5.1
Organizational Productivity- Portals & Collaboration Lotus Quickr for Domino Directory AIX, i5/OS, IBM i, Linux, Windows 8.5, 8.2, 8.1, 8.0

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

IBM Domino
LDAP

Software version:

6.0, 6.5, 7.0, 8.0, 8.5

Operating system(s):

AIX, IBM i, Linux, Solaris, Windows, i5/OS, z/OS

Reference #:

7002627

Modified date:

2011-10-07

Translate my page

Machine Translation

Content navigation