![Netscape NETSCAPE DIRECTORY SERVER 6.02 Administrator'S Manual Download Page 510](http://html1.mh-extra.com/html/netscape/netscape-directory-server-6-02/netscape-directory-server-6-02_administrators-manual_1674673510.webp)
LDAP Search Filters
510
Netscape Directory Server Administrator’s Guide • May 2002
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"
LDAP Search Filters
Search filters select the entries to be returned for a search operation. They are most
commonly used with the
ldapsearch
command-line utility. When you use
ldapsearch
, you can place multiple search filters in a file, with each filter on a
separate line in the file, or you can specify a search filter directly on the command
line.
Summary of Contents for NETSCAPE DIRECTORY SERVER 6.02
Page 1: ...Administrator s Guide Netscape Directory Server Version6 02 May 2002 ...
Page 16: ...16 Netscape Directory Server Administrator s Guide May 2002 ...
Page 20: ...20 Netscape Directory Server Administrator s Guide May 2002 ...
Page 74: ...Maintaining Referential Integrity 74 Netscape Directory Server Administrator s Guide May 2002 ...
Page 138: ...Using Referrals 138 Netscape Directory Server Administrator s Guide May 2002 ...
Page 432: ...Miscellaneous Tuning Tips 432 Netscape Directory Server Administrator s Guide May 2002 ...
Page 434: ...434 Netscape Directory Server Administrator s Guide May 2002 ...
Page 468: ...PTA Plug In Syntax Examples 468 Netscape Directory Server Administrator s Guide May 2002 ...
Page 488: ...488 Netscape Directory Server Administrator s Guide May 2002 ...
Page 528: ...Examples of LDAP URLs 528 Netscape Directory Server Administrator s Guide May 2002 ...