![Netscape NETSCAPE DIRECTORY SERVER 6.1 - ADMINISTRATOR Administrator'S Manual Download Page 520](http://html1.mh-extra.com/html/netscape/netscape-directory-server-6-1-administrator/netscape-directory-server-6-1-administrator_administrators-manual_1674675520.webp)
Using ldapsearch
520
Netscape Directory Server Administrator’s Guide • August 2002
Specifying Search Filters Using a File
You can enter search filters into a file instead of entering them on the command
line. When you do this, specify each search filter on a separate line in the file. The
ldapsearch
command runs each search in the order in which it appears in the file.
For example, if the file contains:
sn=Francis
givenname=Richard
then
ldapsearch
first finds all the entries with the surname Francis, and then all
the entries with the givenname Richard. If an entry is found that matches both
search criteria, then the entry is returned twice.
For example, suppose you specified the previous search filters in a file named
searchdb
, and you set your search base using
LDAP_BASEDN
. Then the following
returns all the entries that match either search filter:
ldapsearch -h mozilla -f searchdb
You can limit the set of attributes returned here by specifying the attribute names
that you want at the end of the search line. For example, the following
ldapsearch
command performs both searches, but returns only the DN and and the
givenname
and
sn
attributes of each entry:
ldapsearch -h mozilla -f searchdb sn givenname
Specifying DNs that Contain Commas in Search Filters
When a DN within a search filter contains a comma as part of its value, you must
escape the comma with a backslash (\). For example, to find everyone in the
example.com Bolivia, S.A.
subtree, use the following command:
ldapsearch -h mozilla -s base -b "o=example.com Bolivia\,
S.A.,dc=example,dc=com" "objectclass=*"
Using Client Authentication When Searching
This example shows user
bjensen
searching the directory using client
authentication:
ldapsearch -h mozilla -p 636 -b "dc=example,dc=com" -N
"bjensenscertname" -Z -W
certdbpassword
-P /home/bjensen/certdb/cert.db
"givenname=Richard"
Summary of Contents for NETSCAPE DIRECTORY SERVER 6.1 - ADMINISTRATOR
Page 1: ...Administrator s Guide Netscape Directory Server Version6 1 August 2002...
Page 20: ...20 Netscape Directory Server Administrator s Guide August 2002...
Page 24: ...24 Netscape Directory Server Administrator s Guide August 2002...
Page 142: ...Using Referrals 142 Netscape Directory Server Administrator s Guide August 2002...
Page 440: ...Miscellaneous Tuning Tips 440 Netscape Directory Server Administrator s Guide August 2002...
Page 442: ...442 Netscape Directory Server Administrator s Guide August 2002...
Page 478: ...PTA Plug In Syntax Examples 478 Netscape Directory Server Administrator s Guide August 2002...
Page 498: ...498 Netscape Directory Server Administrator s Guide August 2002...
Page 538: ...Examples of LDAP URLs 538 Netscape Directory Server Administrator s Guide August 2002...