Previous Topic: DXloaddb Tool—Load a Datastore from an LDIF File

Next Topic: DXnewdb Tool—Create a New Datastore

DXmodify Tool—Add New or Changed Information to a Directory

Use the DXmodify tool to do any of the following:

When you run the DXmodify tool, you can enter the new or changed information from standard input or from an LDIF file.

This command has the following format:

dxmodify [action] [options]

Example: dxldap.conf file on a Windows System, Specifying the TLS_REQCERT Setting

TLS_CACERT  c:\program files\CA\Directory\dxserver\config\ssld\trusted.pem
TLS_REQCERT allow

Example: dxldap.conf file on a UNIX System, Using the Default TLS_REQECRT Setting

TLS_CACERT  /opt/CA/Directory/dxserver/config/ssld/trusted.pem

Example: Make Multiple Changes to an Entry

This example uses the Democorp sample directory supplied with CA Directory. You can repeat this example as a training exercise.

You can make multiple changes, such as changing the title and postal address, adding a second telephone number, and deleting the description of an entry.

This example shows that you can replace the values of multiple attributes using one replace statement as long as the replace statement specifies the first attribute name in the series.

  1. Create an LDIF file named h-modify.ldif that contains the following:
    dn: cn=Murray HORSFALL, ou=Repair,ou=Operations,o=Democorp,c=AU
    changetype: modify
    replace: title
    title: Chief Information Officer
    -
    add: telephone
    telephone: 797 8888
    -
    delete: description
    -
    replace: postalAddress
    postalAddress: 173 Toorak Rd $ South Yarra
    postalCode: 3066
    
  2. Use DXmodify to apply the edited file as follows:
    dxmodify -h localhost:19389 -f h-modify.ldif
    

Example: Add a Binary File

This shows how to add a JPEG file with a personnel record from staff.ldif.

For JPEG files, the object class is cosinePilotObject, the X.500 attribute name is cosineJpegPhoto, and the LDAP attribute name is JpegPhoto.

This example uses the Democorp sample directory supplied with CA Directory. You can repeat this example as a training exercise.

To add a binary file, follow these instructions:

  1. Decide on the directory schema object class and attribute to use to hold the binary data.

    For this example, use the cosineJpegPhoto attribute within the cosinePilotObject object class.

  2. Create entries in an LDIF file with the following syntax:
    attributeName:< FILE://path
    

    For this example, create staff.ldif with the following form:

    dn: cn=Peter Bell,ou=Infrastructure,ou=Support,o=Democorp,c=AU
    oc: organizationalPerson
    oc: newPilotPerson
    oc: cosinePilotObject
    cn: Peter Bell
    sn: BELL
    cosineJpegPhoto:< FILE://d:\temp\PHOTO\BELPE01.jpg
    title: Design Supervisor
    telephone: 881 9256
    description: Computing
    mail: Peter.BELL@Democorp.com
    postalAddress: 7-11 Fine Street$Penville CA
    postalCode: 32750
    
  3. Run the following command:
    dxmodify -a -c -h hostname:19389 -f staff.ldif
    


Copyright © 2009 CA. All rights reserved. Email CA about this topic