This appendix gives some common usage scenarios and examples for using these LDAP tools.
A.1. Running Extended Operations
Red Hat Directory Server supports a variety of extended operations, especially extended search operations. An extended operation passes an additional operation (such as a get effective rights search or server-side sort) along with the LDAP operation. Likewise, LDAP clients have the potential to support a number of extended operations.
The OpenLDAP LDAP tools support extended operations in two ways. All client tools (
ldapsearch, and the others) use either the
-E options to send an extended operation. The
-e argument can be used with any OpenLDAP client tool and sends general instructions about the operation, like how to handle password policies. The
-E is used only with
ldapsearches and passes more useful controls like GER searches, sort and page information, and information for other, not-explicitly-support extended operations.
Additionally, OpenLDAP has another tool,
ldapexop, which is used exclusively to perform extended search operations, the same as running
The format of an extended operation with
ldapsearch is generally:
When an extended operation is explicitly handled by the OpenLDAP tools, then the extended_operation_type can be an alias, like
deref for a dereference search or
sss for server-side sorting. A supported extended operation has formatted output. Other extended operations, like GER searches, are passed using their OID rather than an alias, and then the extended_operation_type is the OID. For those unsupported operations the tool does not recognize the response from the server, so the output is unformatted.
For example, the
pg extended operation type formats the results in simple pages:
# ldapsearch -x -D "cn=Directory Manager" -W -b "ou=Engineers,ou=People,dc=example,dc=com" -E pg=3 "(objectclass=*)" cn
cn: John Smith
cn: Barbara Jensen
cn: Henry Martin
Results are sorted.
next page size (3): 5
The same operation with
ldapexop can be run using only the OID of the simple paged results operation and the operation's settings (3 results per page):
ldapexop does not accept the same range of search parameters that
ldapsearch does, making it less flexible.