1 .TH LDAPMODIFY 1 "10 November 1998" "OpenLDAP LDVERSION"
3 ldapmodify, ldapadd \- ldap modify entry and ldap add entry tools
21 .BI \-d \ debuglevel\fR]
27 .BI \-h \ ldaphost\fR]
29 .BI \-p \ ldapport\fR]
49 .BI \-d \ debuglevel\fR]
55 .BI \-h \ ldaphost\fR]
57 .BI \-p \ ldapport\fR]
62 is a shell-accessible interface to the
68 is implemented as a hard link to the ldapmodify tool. When invoked as
70 the -a (add new entry) flag is turned on automatically.
73 opens a connection to an LDAP server, binds, and modifies or adds entries.
74 The entry information is read from standard input or from \fIfile\fP through
75 the use of the -f option.
79 Add new entries. The default for
81 is to modify existing entries. If invoked as
83 this flag is always set.
86 Assume that any values that start with a `/' are binary values and that
87 the actual value is in a file whose path is specified in the place where
88 values normally appear.
91 Continuous operation mode. Errors are reported, but
93 will continue with modifications. The default is to exit after
97 Replace existing values by default.
100 Show what would be done, but don't actually modify entries. Useful for
101 debugging in conjunction with -v.
104 Use verbose mode, with many diagnostics written to standard output.
107 Use Kerberos authentication instead of simple authentication. It is
108 assumed that you already have a valid ticket granting ticket. You must
109 compile with KERBEROS defined for this option to have any effect.
112 Same as \-k, but only does step 1 of the kerberos bind. This is useful
113 when connecting to a slapd and there is no x500dsa.hostname principal
114 registered with your kerberos servers.
117 Force application of all changes regardless of the contents of input
118 lines that begin with
120 (by default, replica: lines are compared against the LDAP server host
121 and port in use to decide if a replog record should actually be applied).
124 Set the LDAP debugging level to \fIdebuglevel\fP.
126 must be compiled with LDAP_DEBUG defined for this option to have any effect.
129 Read the entry modification information from \fIfile\fP instead of from
133 Use \fIbinddn\fP to bind to the LDAP directory. \fIbinddn\fP should be
134 a string-represented DN as defined in RFC 1779.
137 Use \fIpasswd\fP as the password for simple authentication.
140 Specify an alternate host on which the ldap server is running.
143 Specify an alternate TCP port where the ldap server is listening.
145 The contents of \fIfile\fP (or standard input if no \-f flag is given on
146 the command line) should conform to the format defined in
147 .BR slapd.replog (5),
148 with the exceptions noted below.
150 If the first line of a record consists of a decimal number (entry id),
153 Lines that begin with "replica:" are matched against the LDAP server host
154 and port in use to decide if a particular replog record should be applied.
155 Any other lines that precede the "dn:" line are ignored.
156 The -F flag can be used to force
158 to apply all of the replog changes, regardless of the presence or
159 absence of any "replica:" lines.
161 If no "changetype:" line is present, the default is "add" if the -a
162 flag is set (or if the program was invoked as
164 and "modify" otherwise.
166 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
167 appear, the default is "replace" if the -r flag is set and "add"
170 Note that the above exceptions to the
174 entries to be used as input to
178 .SH ALTERNATIVE INPUT FORMAT
179 An alternative input format is supported for compatibility with older
182 This format consists of one or more entries separated by blank lines,
183 where each entry looks like:
186 Distinguished Name (DN)
191 where \fIattr\fP is the name of the attribute and \fIvalue\fP is the
194 By default, values are added. If the
197 given, the default is to replace existing values with the new one.
198 Note that it is permissible for a given attribute to appear more than
199 once (for example, to add more than one value for an attribute). Also
200 note that you can use a trailing `\\' to continue values across lines and
201 preserve newlines in the value itself (this is useful for modifying
202 QUIPU iattr attributes among others).
205 should be preceded by a \fB-\fP to remove a value. The `=' and
206 value should be omitted to remove an entire attribute.
209 should be preceded by a \fB+\fP to add a value in the presence of the
213 Assuming that the file
215 exists and has the contents:
218 dn: cn=Modify Me, o=University of Michigan, c=US
221 mail: modme@terminator.rs.itd.umich.edu
227 jpegPhoto: /tmp/modme.jpeg
236 ldapmodify -b -r -f /tmp/entrymods
239 will replace the contents of the "Modify Me" entry's
241 attribute with the value "modme@terminator.rs.itd.umich.edu", add a
243 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
246 and completely remove the
249 The same modifications as above can be performed using the older
254 cn=Modify Me, o=University of Michigan, c=US
255 mail=modme@terminator.rs.itd.umich.edu
257 +jpegPhoto=/tmp/modme.jpeg
264 ldapmodify -b -r -f /tmp/entrymods
267 Assuming that the file
269 exists and has the contents:
272 dn: cn=Barbara Jensen, o=University of Michigan, c=US
277 title: the world's most famous mythical manager
278 mail: bjensen@terminator.rs.itd.umich.edu
284 ldapadd -f /tmp/entrymods
287 will add a new entry for Babs Jensen, using the values from the
291 Assuming that the file
293 exists and has the contents:
296 dn: cn=Barbara Jensen, o=University of Michigan, c=US
302 ldapmodify -f /tmp/entrymods
305 will remove Babs Jensen's entry.
307 Exit status is 0 if no errors occur. Errors result in a non-zero exit
308 status and a diagnostic message being written to standard error.
323 .IR "A String Representation of Distinguished Names",
326 ISODE Consortium, March 1995.
328 There is no interactive mode, but there probably should be.
331 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
333 is derived from University of Michigan LDAP 3.3 Release.