'\" t
|
.\" Title: ldapsearch
|
.\" Author: Mark Craig
|
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
|
.\" Date: October\ \&20,\ \&2011
|
.\" Manual: Tools Reference
|
.\" Source: OpenDJ 2.5.0
|
.\" Language: English
|
.\"
|
.TH "LDAPSEARCH" "1" "October\ \&20,\ \&2011" "OpenDJ 2\&.5\&.0" "Tools Reference"
|
.\" -----------------------------------------------------------------
|
.\" * Define some portability stuff
|
.\" -----------------------------------------------------------------
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
.\" http://bugs.debian.org/507673
|
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
.ie \n(.g .ds Aq \(aq
|
.el .ds Aq '
|
.\" -----------------------------------------------------------------
|
.\" * set default formatting
|
.\" -----------------------------------------------------------------
|
.\" disable hyphenation
|
.nh
|
.\" disable justification (adjust text to left margin only)
|
.ad l
|
.\" -----------------------------------------------------------------
|
.\" * MAIN CONTENT STARTS HERE *
|
.\" -----------------------------------------------------------------
|
.SH "NAME"
|
ldapsearch \- perform LDAP search operations
|
.SH "SYNOPSIS"
|
.HP \w'\fBldapsearch\fR\ 'u
|
\fBldapsearch\fR {options} [filter] [attributes...]
|
.SH "DESCRIPTION"
|
.PP
|
This utility can be used to perform LDAP search operations in the directory\&.
|
.PP
|
In the list of attributes to return, you can specify
|
*
|
to return all user attributes,
|
+
|
to return all operational attributes, and
|
@\fIobject\-class\fR
|
to return all attributes associated with the
|
\fIobject\-class\fR
|
such as
|
@person\&.
|
.SH "OPTIONS"
|
.PP
|
The following options are supported\&.
|
.PP
|
\fB\-a, \-\-dereferencePolicy {dereferencePolicy}\fR
|
.RS 4
|
Alias dereference policy (\*(Aqnever\*(Aq, \*(Aqalways\*(Aq, \*(Aqsearch\*(Aq, or \*(Aqfind\*(Aq)
|
.sp
|
Default value: never
|
.RE
|
.PP
|
\fB\-A, \-\-typesOnly\fR
|
.RS 4
|
Only retrieve attribute names but not their values
|
.RE
|
.PP
|
\fB\-\-assertionFilter {filter}\fR
|
.RS 4
|
Use the LDAP assertion control with the provided filter
|
.RE
|
.PP
|
\fB\-b, \-\-baseDN {baseDN}\fR
|
.RS 4
|
Base DN format string
|
.RE
|
.PP
|
\fB\-c, \-\-continueOnError\fR
|
.RS 4
|
Continue processing even if there are errors
|
.RE
|
.PP
|
\fB\-C, \-\-persistentSearch ps[:changetype[:changesonly[:entrychgcontrols]]]\fR
|
.RS 4
|
Use the persistent search control
|
.RE
|
.PP
|
\fB\-\-countEntries\fR
|
.RS 4
|
Count the number of entries returned by the server
|
.RE
|
.PP
|
\fB\-e, \-\-getEffectiveRightsAttribute {attribute}\fR
|
.RS 4
|
Specifies geteffectiverights control specific attribute list
|
.RE
|
.PP
|
\fB\-f, \-\-filename {file}\fR
|
.RS 4
|
LDIF file containing the changes to apply
|
.RE
|
.PP
|
\fB\-g, \-\-getEffectiveRightsAuthzid {authzID}\fR
|
.RS 4
|
Use geteffectiverights control with the provided authzid
|
.RE
|
.PP
|
\fB\-G, \-\-virtualListView {before:after:index:count | before:after:value}\fR
|
.RS 4
|
Use the virtual list view control to retrieve the specified results page
|
.RE
|
.PP
|
\fB\-J, \-\-control {controloid[:criticality[:value|::b64value|:<filePath]]}\fR
|
.RS 4
|
Use a request control with the provided information
|
.RE
|
.PP
|
\fB\-l, \-\-timeLimit {timeLimit}\fR
|
.RS 4
|
Maximum length of time in seconds to allow for the search
|
.sp
|
Default value: 0
|
.RE
|
.PP
|
\fB\-\-matchedValuesFilter {filter}\fR
|
.RS 4
|
Use the LDAP matched values control with the provided filter
|
.RE
|
.PP
|
\fB\-n, \-\-dry\-run\fR
|
.RS 4
|
Show what would be done but do not perform any operation
|
.RE
|
.PP
|
\fB\-s, \-\-searchScope {searchScope}\fR
|
.RS 4
|
Search scope (\*(Aqbase\*(Aq, \*(Aqone\*(Aq, \*(Aqsub\*(Aq, or \*(Aqsubordinate\*(Aq)
|
.sp
|
Default value: sub
|
.sp
|
subordinate
|
is an LDAP extension that might not work with all LDAP servers\&.
|
.RE
|
.PP
|
\fB\-S, \-\-sortOrder {sortOrder}\fR
|
.RS 4
|
Sort the results using the provided sort order
|
.RE
|
.PP
|
\fB\-\-simplePageSize {numEntries}\fR
|
.RS 4
|
Use the simple paged results control with the given page size
|
.sp
|
Default value: 1000
|
.RE
|
.PP
|
\fB\-Y, \-\-proxyAs {authzID}\fR
|
.RS 4
|
Use the proxied authorization control with the given authorization ID
|
.RE
|
.PP
|
\fB\-z, \-\-sizeLimit {sizeLimit}\fR
|
.RS 4
|
Maximum number of entries to return from the search
|
.sp
|
Default value: 0
|
.RE
|
.SS "LDAP Connection Options"
|
.PP
|
\fB\-D, \-\-bindDN {bindDN}\fR
|
.RS 4
|
DN to use to bind to the server
|
.sp
|
Default value: cn=Directory Manager
|
.RE
|
.PP
|
\fB\-E, \-\-reportAuthzID\fR
|
.RS 4
|
Use the authorization identity control
|
.RE
|
.PP
|
\fB\-h, \-\-hostname {host}\fR
|
.RS 4
|
Directory server hostname or IP address
|
.sp
|
Default value: localhost\&.localdomain
|
.RE
|
.PP
|
\fB\-j, \-\-bindPasswordFile {bindPasswordFile}\fR
|
.RS 4
|
Bind password file
|
.RE
|
.PP
|
\fB\-K, \-\-keyStorePath {keyStorePath}\fR
|
.RS 4
|
Certificate key store path
|
.RE
|
.PP
|
\fB\-N, \-\-certNickname {nickname}\fR
|
.RS 4
|
Nickname of certificate for SSL client authentication
|
.RE
|
.PP
|
\fB\-o, \-\-saslOption {name=value}\fR
|
.RS 4
|
SASL bind options
|
.RE
|
.PP
|
\fB\-p, \-\-port {port}\fR
|
.RS 4
|
Directory server port number
|
.sp
|
Default value: 389
|
.RE
|
.PP
|
\fB\-P, \-\-trustStorePath {trustStorePath}\fR
|
.RS 4
|
Certificate trust store path
|
.RE
|
.PP
|
\fB\-q, \-\-useStartTLS\fR
|
.RS 4
|
Use StartTLS to secure communication with the server
|
.RE
|
.PP
|
\fB\-T, \-\-trustStorePassword {trustStorePassword}\fR
|
.RS 4
|
Certificate trust store PIN
|
.RE
|
.PP
|
\fB\-u, \-\-keyStorePasswordFile {keyStorePasswordFile}\fR
|
.RS 4
|
Certificate key store PIN file
|
.RE
|
.PP
|
\fB\-U, \-\-trustStorePasswordFile {path}\fR
|
.RS 4
|
Certificate trust store PIN file
|
.RE
|
.PP
|
\fB\-\-usePasswordPolicyControl\fR
|
.RS 4
|
Use the password policy request control
|
.RE
|
.PP
|
\fB\-V, \-\-ldapVersion {version}\fR
|
.RS 4
|
LDAP protocol version number
|
.sp
|
Default value: 3
|
.RE
|
.PP
|
\fB\-w, \-\-bindPassword {bindPassword}\fR
|
.RS 4
|
Password to use to bind to the server
|
.RE
|
.PP
|
\fB\-W, \-\-keyStorePassword {keyStorePassword}\fR
|
.RS 4
|
Certificate key store PIN
|
.RE
|
.PP
|
\fB\-X, \-\-trustAll\fR
|
.RS 4
|
Trust all server SSL certificates
|
.RE
|
.PP
|
\fB\-Z, \-\-useSSL\fR
|
.RS 4
|
Use SSL for secure communication with the server
|
.RE
|
.SS "Utility Input/Output Options"
|
.PP
|
\fB\-i, \-\-encoding {encoding}\fR
|
.RS 4
|
Use the specified character set for command\-line input
|
.RE
|
.PP
|
\fB\-\-noPropertiesFile\fR
|
.RS 4
|
No properties file will be used to get default command line argument values
|
.RE
|
.PP
|
\fB\-\-propertiesFilePath {propertiesFilePath}\fR
|
.RS 4
|
Path to the file containing default property values used for command line arguments
|
.RE
|
.PP
|
\fB\-t, \-\-dontWrap\fR
|
.RS 4
|
Do not wrap long lines
|
.RE
|
.PP
|
\fB\-v, \-\-verbose\fR
|
.RS 4
|
Use verbose mode
|
.RE
|
.SS "General Options"
|
.PP
|
\fB\-\-version\fR
|
.RS 4
|
Display version information
|
.RE
|
.PP
|
\fB\-?, \-H, \-\-help\fR
|
.RS 4
|
Display usage information
|
.RE
|
.SH "EXIT CODES"
|
.PP
|
0
|
.RS 4
|
The command completed successfully\&.
|
.RE
|
.PP
|
\fIldap\-error\fR
|
.RS 4
|
An LDAP error occurred while processing the operation\&.
|
.sp
|
LDAP result codes are described in
|
\m[blue]\fBRFC 4511\fR\m[]\&. Also see the additional information for details\&.
|
.RE
|
.PP
|
89
|
.RS 4
|
An error occurred while parsing the command\-line arguments\&.
|
.RE
|
.SH "FILES"
|
.PP
|
You can use
|
~/\&.opendj/tools\&.properties
|
to set the defaults for bind DN, host name, and port number as in the following example\&.
|
.sp
|
.if n \{\
|
.RS 4
|
.\}
|
.nf
|
hostname=directory\&.example\&.com
|
port=1389
|
bindDN=uid=kvaughan,ou=People,dc=example,dc=com
|
|
ldapcompare\&.port=1389
|
ldapdelete\&.port=1389
|
ldapmodify\&.port=1389
|
ldappasswordmodify\&.port=1389
|
ldapsearch\&.port=1389
|
.fi
|
.if n \{\
|
.RE
|
.\}
|
.SH "EXAMPLES"
|
.PP
|
The following example searches for entries with UID containing
|
jensen, returning only DNs and uid values\&.
|
.sp
|
.if n \{\
|
.RS 4
|
.\}
|
.nf
|
$ ldapsearch \-p 1389 \-b dc=example,dc=com "(uid=*jensen*)" uid
|
dn: uid=ajensen,ou=People,dc=example,dc=com
|
uid: ajensen
|
|
dn: uid=bjensen,ou=People,dc=example,dc=com
|
uid: bjensen
|
|
dn: uid=gjensen,ou=People,dc=example,dc=com
|
uid: gjensen
|
|
dn: uid=jjensen,ou=People,dc=example,dc=com
|
uid: jjensen
|
|
dn: uid=kjensen,ou=People,dc=example,dc=com
|
uid: kjensen
|
|
dn: uid=rjensen,ou=People,dc=example,dc=com
|
uid: rjensen
|
|
dn: uid=tjensen,ou=People,dc=example,dc=com
|
uid: tjensen
|
|
|
Result Code: 0 (Success)
|
.fi
|
.if n \{\
|
.RE
|
.\}
|
.SH "AUTHORS"
|
.PP
|
\fBMark Craig\fR
|
.RS 4
|
Author.
|
.RE
|
.PP
|
\fBNemanja Lukić\fR
|
.RS 4
|
Author.
|
.RE
|
.SH "COPYRIGHT"
|
.br
|
Copyright \(co 2011 ForgeRock AS
|
.br
|
.sp
|
.RS 4
|
[IMAGE]
|
.PP
|
This work is licensed under the
|
\m[blue]\fBCreative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License\fR\m[].
|
.RE
|
.PP
|
To view a copy of this license, visit
|
http://creativecommons.org/licenses/by-nc-nd/3.0/
|
or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
|
.PP
|
Trademarks are the property of their respective owners.
|
.PP
|
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
.PP
|
EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
.sp
|