You can run the ldapmodify tool’s --useTransaction option to process multiple operations as part of a single batched transaction.

  1. Create a batch text file with the changes that you want to apply as a single atomic unit.
    dn:uid=user.3,ou=People,dc=example,dc=com 
    changetype: delete
    dn:uid=user.1,ou=People,dc=example,dc=com 
    changetype: modify 
    replace: pager 
    pager: +1 383 288 1090
  2. To run the batched transaction, run the ldapmodify tool with the --useTransaction and --filename options.
    $ bin/ldapmodify --useTransaction --filename test.ldif
    #Successfully created a transaction with transaction ID 400 
    #Processing DELETE request for uid=user.3,ou=People,dc=example,dc=com 
    #DELETE operation successful for DN uid=user.3,ou=People,dc=example,dc=com 
    #This operation will be processed as part of transaction 400 
    #Processing MODIFY request for uid=user.1,ou=People,dc=example,dc=com 
    #MODIFY operation successful for DN uid=user.1,ou=People,dc=example,dc=com 
    #This operation will be processed as part of transaction 400 
    #Successfully committed transaction 400