Table of ldapsearch parameters
The following table describes the case-sensitive parameters you can use with ldapsearch.
About this task
Parameter |
Use to |
---|---|
-? |
Print help on using ldapsearch. |
-a deref |
Specify alias de-referencing. Enter never, always, search, or find. Never is the default if you do not use this parameter. |
-A |
Retrieve only attribute names, not the values for the attributes. |
-b base dn |
Specify a distinguished name to use as the starting point for beginning the search. Use quotation marks to specify the value -- for example: "ou=West,o=Renovations,c=US" You must use this parameter if the server you're searching requires you to specify a search base. Otherwise, it is optional. Optionally
use |
-B |
Allow printing of non-ASCII values |
-D bind dn |
Specify a distinguished name that the server uses to authenticate you. The name must correspond to an entry in the directory and must have the necessary access to search the directory. Specify the name in quotation marks -- for example: "cn=Directory Manager,o=Renovations,c=US" If you don't use this
parameter, the connection to the server occurs anonymously. You must
use Along
with |
-f file |
Specify a file that contains search filters
to use -- for example, |
-F sep |
Print sep rather than equal sign (=) between attribute names and values. Use this parameter, for example, if a tool that reads the ldapsearch output expects a different separator. |
-h host name |
Specify the host name of the server to which you're connecting -- for example, -h server.renovations.com. |
-l timelimit |
Specify a time limit (in seconds) for the search to complete. If you do not specify this parameter or if you specify a limit of 0, searches can take an unlimited amount of time. ldapsearch never waits longer than a search time limit set on the server, however. |
-L |
Specify that the output is in LDIF format. LDIF format uses a colon (:) as the attribute delineator rather than an equal sign (=). LDIF is useful for adding or modifying many directory entries at once. For example, you can import the contents of the output into an LDAP-compliant directory. |
-M |
Manage referral objects as normal entries so that ldapsearch returns attributes for the referral entries themselves, rather than for the entries referred to. |
-n |
Show how a search would be performed, but do not actually perform the search. |
-p port |
Specify the port that the server uses. If you don't use this parameter, ldapsearch uses port 389. |
-R |
Do not automatically follow search references returned by the server. |
-s scope |
Specify the scope of the search when you use
the
The order in which you specify |
-S attribute |
Sort the results by a specified attribute. |
-z sizelimit |
Specify the maximum number of entries to return. If you don't specify this parameter or if you specify a limit of 0, an unlimited number of entries are returned. ldapsearch never returns more entries than the server allows, however. |
-u |
Specify that ldapsearch return distinguished names in a user-friendly format. |
-v |
Specify that ldapsearch run in verbose mode. |
-w password |
Specify the password associated with a distinguished
name used with the |
-x |
Use with |