Importing Data into an ADAM Instance






Importing Data into an ADAM Instance

Problem

You want to perform a bulk import of object data into an ADAM instance.

Solution

Using a command-line interface

To import objects using the ldifde utility, you must first create an LDIF file with the objects to add, modify, or delete. Here is an example LDIF file that adds three users to an ADAM application partition:

	dn: cn=Joe Smith,cn=users,ou=AdamUsers,o=rallencorp,c=us
	changetype: add
	objectClass: user
	cn: Joe Smith
	name: Joe Smith

	dn: cn=Richard Mahler,cn=users,ou=AdamUsers,o=rallencorp,c=us
	changetype: add
	objectClass: user
	cn: Richard Mahler
	name: Richard Mahler

	dn: cn=Doug Martin,cn=users,ou= 
AdamUsers,o=rallencorp,c=us
	changetype: add
	objectClass: user
	cn: Doug Martin
	name: Doug Martin

Once you've created the LDIF file, you just need to run ldifde to import the new objects:

	> ldifde -i -f c:\import.ldf -s <servername>:<portnumber> -k -j

Be sure to use the version of ldifde that came with R2, not one from a previous version of the Windows OS or ADAM.


Discussion

For more information on the LDIF format, check RFC 2849.

Using a command-line interface

To import with ldifde, simply specify the -i switch to turn on import mode and -f <filename> for the file. It can also be beneficial to use the -v switch to turn on verbose mode to get more information in case of errors.

See Also

Recipe 4.29 for information on importing data using LDIF files, RFC 2849 (The LDAP Data Interchange Format (LDIF)Technical Specification), MS KB 237677 (Using LDIFDE to Import and Export Directory Objects to Active Directory), and Chapter 18 of Active Directory, Third Edition, by Joe Richards et al. (O'Reilly)



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows