Ldapsearch Examples; Returning All Entries; Specifying Search Filters On The Command-Line; Searching The Root Dse Entry - Red Hat DIRECTORY SERVER 7.1 - ADMINISTRATOR Administrator's Manual

Table of Contents

Advertisement

Using ldapsearch

ldapsearch Examples

In the next set of examples, suppose the following are true:
You want to perform a search of all entries in the directory.
You have configured your directory to support anonymous access for search
and read. You do not have to specify any bind information in order to
perform the search. For more information on anonymous access, see
"Defining User Access - userdn Keyword," on page 221.
The server is located on hostname
The server uses port number
have to identify the port number on the search request.
SSL is enabled for the server on port
The suffix under which all data is stored is

Returning All Entries

Given the previous information, the following call will return all entries in the
directory:
ldapsearch -h mozilla -b "dc=example,dc=com" -s sub
"objectclass=*"
"objectclass=*"

Specifying Search Filters on the Command-Line

You can specify a search filter directly on the command-line. If you do this, be
sure to enclose your filter in quotation marks ("filter"). Also, do not specify the
option. For example:
ldapsearch -h mozilla -b "dc=example,dc=com" "cn=babs jensen"

Searching the Root DSE Entry

The root DSE is a special entry that contains a list of all the suffixes supported by
the local Directory Server. You can search this entry by supplying a search base of
"". You must also specify a search scope of
For example:
ldapsearch -h mozilla -b "" -s base "objectclass=*"
592
Red Hat Directory Server Administrator's Guide • May 2005
mozilla
. Since this is the default port, you do not
389
is a search filter that matches any entry in the directory.
.
(the default SSL port number).
636
dc=example,dc=com
and a filter of
base
.
-f
.
"objectclass=*"

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 7.1

Table of Contents