Specifying Search Filters Using A File; Specifying Dns That Contain Commas In Search Filters; Using Client Authentication When Searching - Netscape DIRECTORY SERVER 6.1 - ADMINISTRATOR Administrator's Manual

Table of Contents

Advertisement

Using ldapsearch

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
For example, if the file contains:
sn=Francis
givenname=Richard
then
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
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
command performs both searches, but returns only the DN and and the
and
sn
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.
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
authentication:
ldapsearch -h mozilla -p 636 -b "dc=example,dc=com" -N
"bjensenscertname" -Z -W certdbpassword -P /home/bjensen/certdb/cert.db
"givenname=Richard"
520
Netscape Directory Server Administrator's Guide • August 2002
command runs each search in the order in which it appears in the file.
first finds all the entries with the surname Francis, and then all
ldapsearch
, and you set your search base using
attributes of each entry:
LDAP_BASEDN
subtree, use the following command:
searching the directory using client
bjensen
. Then the following
ldapsearch
givenname

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.1

Table of Contents