1.7 Sample Commands

Listed below are sample commands that can be used with the utility for the following functions: 

1.7.1 Performing an LDIF Import

To perform an LDIF import, use a command similar to the following:

 ice -SLDIF -fc:\temp\chapter2.ldif -DLDAP ‑sserver1.acme.com -p389 -dcn=admin,c=us -wsecret
 

This particular command line reads LDIF data from the c:\temp\chapter2.ldif file and sends it to the LDAP server server1.acme.com at port 389 using the identity cn=admin,c=us, and password “secret.”

1.7.2 Performing an LDIF Export

To perform an LDIF export, use a command similar to the following:

 ice -SLDAP -sserver1.acme.com -p389 -dcn=admin,c=us ‑wpassword -lobjectClass=* -csub -DLDIF ‑fc:\temp\server1.ldif
 

This command line performs a subtree search for all objects in the server server1.acme.com at port 389 using the identity cn=admin,c=us, and password “password” and outputs the data in LDIF format to the c:\tmp\server1.ldif file.

1.7.3 Performing a Comma-Delimited Import

To perform a comma-delimited import, use a command similar to the following:

 ice -SDELIM -fc:\tmp\in.csv -Fc:\tmp\order.csv -ncn 
 -lo=acme -DLDAP -sserver1.acme.com -p389 
 -dcn=admin,c=us -wsecret
 

This command reads comma-delimited values from the c:\tmp\in.csv file and reads the attribute order from the c:\tmp\order.csv file. For each attribute entry in in.csv, the attribute type is specified in order.csv. For example, if in.csv contains the following:

 pat,engineer,555-1212,pat@acme.com,"Acme, Inc."
 

Then order.csv would contain the following:

 cn,title,phonenumber,emailaddress,company
 

The information in order.csv could be input directly using the -t option.

The data is then sent to the LDAP server server1.acme.com at port 389 using the identity cn=admin,c=us, and password “secret.”

We specified that cn should become the new DN for this object using the -n option, and we added this object to the organization container acme using the -l option.

1.7.4 Performing a Comma-Delimited Export

To perform a comma-delimited export, use a command similar to the following:

 ice -SLDAP -sserver1.acme.com -p389 -dcn=admin,c=us ‑wpassword -lobjectClass=* -csub -DDELIM 
 -fc:\tmp\server1.csv -Forder.csv
 

This command line performs a subtree search for all objects in the server server1.acme.com at port 389 using the identity cn=admin,c=us, and password “password” and outputs the data in comma-delimited format to the c:\tmp\server1.csv file.

1.7.5 Performing a Data Migration between LDAP Servers

To perform a data migration between LDAP servers, use a command similar to the following:

 ice -SLDAP -sserver1.acme.com -p389 -dcn=admin,c=us ‑wpassword -lobjectClass=* -csub -DLDAP ‑sserver2.acme.com -p389 -dcn=admin,c=us -wpassword
 

This particular command line performs a subtree search for all objects in the server server1.acme.com at port 389 using the identity cn=admin,c=us with password “password” and sends it to the LDAP server server1.acme.com at port 389 using the identity cn=admin,c=us and password “secret.”