<?xml version="1.0" encoding="UTF-8"?>
<!--
! CCPL HEADER START
!
! This work is licensed under the Creative Commons
! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
! 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.
!
! You can also obtain a copy of the license at
! trunk/opendj3/legal-notices/CC-BY-NC-ND.txt.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! If applicable, add the following below this CCPL HEADER, with the fields
! enclosed by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CCPL HEADER END
!
! Copyright 2011-2012 ForgeRock AS
! Portions Copyright 2013 Jens Elkner
!
-->
<refentry xml:id="ldapmodify-1" xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="common.xml" xpointer='xpointer(//info[@name="info"])'/>
<refmeta>
<refentrytitle><application>ldapmodify</application></refentrytitle>
<xi:include href="common.xml" xpointer='xpointer(//manvolnum[@name="v1m"])'/>
</refmeta>
<refnamediv>
<refname><application>ldapmodify</application></refname>
<refpurpose>perform LDAP modify, add, delete, mod DN operations</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>ldapmodify</command>
<arg>-a</arg>
<arg>--postReadAttributes <replaceable class="parameter">attrList</replaceable></arg>
<arg>--preReadAttributes <replaceable class="parameter">attrList</replaceable></arg>
<sbr/><sbr/>
<xi:include href="common.xml" xpointer='xpointer(//para[@name="s-ops"]/*)'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-proto"]/*[not(@name="sc-policy")])'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-remote"]/*)'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-auth"]/*)'/>
<arg>-r</arg>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-props"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-misc"]/*[not(@name="sc-quiet"
or @name="sc-script")])'/>
<arg>--version</arg>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-general"]/*[@name="sc-help"])'/>
</cmdsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>
This utility can be used to perform LDAP modify, add, delete, and modify DN
operations in the directory. When not using a file to specify modifications,
end your input with EOF (Ctrl+D on UNIX).
</para>
</refsection>
<refsection>
<title>Options</title>
<para>The following options are supported.</para>
<variablelist>
<varlistentry>
<term><option>-a, --defaultAdd</option></term>
<listitem>
<para>
Treat records with no changetype as add operations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--postReadAttributes</option> <replaceable
class="parameter">attrList</replaceable></term>
<listitem>
<para>
Use the LDAP ReadEntry post-read control.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--preReadAttributes</option> <replaceable
class="parameter">attrList</replaceable></term>
<listitem>
<para>
Use the LDAP ReadEntry pre-read control.</para>
</listitem>
</varlistentry>
<xi:include href="common.xml" xpointer='xpointer(//para[@name="l-ops"]/*)'/>
</variablelist>
<refsection>
<title>LDAP Connection Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-proto"]/*[not(@name="lc-policy")])'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-remote"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-auth"]/*)'/>
<varlistentry>
<term><option>-r, --useSASLExternal</option></term>
<listitem>
<para>
Use the SASL EXTERNAL authentication mechanism.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Utility Input/Output Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-props"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-misc"]/*[not(@name="lc-quiet"
or @name="lc-script")])'/>
</variablelist>
</refsection>
<refsection>
<title>General Options</title>
<variablelist>
<varlistentry>
<term><option>--version</option></term>
<listitem>
<para>
Display version information.
</para>
</listitem>
</varlistentry>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-general"]/*[@name="lc-help"])'/>
</variablelist>
</refsection>
</refsection>
<refsection>
<title>Examples</title>
<informalexample>
<para>
The following example demonstrates use of the command to add an entry to the
directory.
</para>
<literallayout><prompt
>$ </prompt><command>cat newuser.ldif</command></literallayout>
<screen>
dn: uid=newuser,ou=People,dc=example,dc=com
uid: newuser
facsimileTelephoneNumber: +1 408 555 1213
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
givenName: New
cn: New User
cn: Real Name
telephoneNumber: +1 408 555 1212
sn: Jensen
roomNumber: 1234
homeDirectory: /home/newuser
uidNumber: 10389
mail: newuser@example.com
l: South Pole
ou: Product Development
ou: People
gidNumber: 10636
</screen>
<literallayout><prompt
>$ </prompt><command>ldapmodify -p 1389 -a -f newuser.ldif \
-D uid=kvaughan,ou=people,dc=example,dc=com -w bribery</command></literallayout>
<screen>
Processing ADD request for uid=newuser,ou=People,dc=example,dc=com
ADD operation successful for DN uid=newuser,ou=People,dc=example,dc=com
</screen>
</informalexample>
<informalexample>
<para>
The following example demonstrates adding a Description attribute to the new
user's entry.
</para>
<literallayout><prompt
>$ </prompt><command>cat newdesc.ldif</command></literallayout>
<screen>
dn: uid=newuser,ou=People,dc=example,dc=com
changetype: modify
add: description
description: A new user's entry
</screen>
<literallayout><prompt
>$ </prompt><command>ldapmodify -p 1389 -f newdesc.ldif \
-D uid=kvaughan,ou=people,dc=example,dc=com -w bribery</command></literallayout>
<screen>
Processing MODIFY request for uid=newuser,ou=People,dc=example,dc=com
MODIFY operation successful for DN uid=newuser,ou=People,dc=example,dc=com
</screen>
</informalexample>
<informalexample>
<para>
The following example demonstrates changing the Description attribute for the
new user's entry.
</para>
<literallayout><prompt
>$ </prompt><command>cat moddesc.ldif</command></literallayout>
<screen>
dn: uid=newuser,ou=People,dc=example,dc=com
changetype: modify
replace: description
description: Another description
</screen>
<literallayout><prompt
>$ </prompt><command>ldapmodify -p 1389 -f moddesc.ldif \
-D uid=kvaughan,ou=people,dc=example,dc=com -w bribery</command></literallayout>
<screen>
Processing MODIFY request for uid=newuser,ou=People,dc=example,dc=com
MODIFY operation successful for DN uid=newuser,ou=People,dc=example,dc=com
</screen>
</informalexample>
<informalexample>
<para>
The following example demonstrates deleting the new user's entry.
</para>
<literallayout><prompt
>$ </prompt><command>cat deluser.ldif</command></literallayout>
<screen>
dn: uid=newuser,ou=People,dc=example,dc=com
changetype: delete
</screen>
<literallayout><prompt
>$ </prompt><command>ldapmodify -p 1389 -f deluser.ldif \
-D uid=kvaughan,ou=people,dc=example,dc=com -w bribery</command></literallayout>
<screen>
Processing DELETE request for uid=newuser,ou=People,dc=example,dc=com
DELETE operation successful for DN uid=newuser,ou=People,dc=example,dc=com
</screen>
</informalexample>
</refsection>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="env"])'/>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="exit-ops"])'/>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="seeAlso"])'/>
</refentry>