Article

hendersj's picture
article
Reads:

4345

Score:
0
0
 
Comments:

0

Mass Data Addition for Existing eDirectory Users

(View Disclaimer)

Problem

A Forum reader recently asked:

"I need to import employeeID and company information from a csv file into eDirectory. I know you are supposed to be able to do this with ICE but most of what I'm finding in the TIDs tells me how to bulk import users, not change or add data for existing users."

And here's the response from eDirectory expert Jim Henderson ...

Solution

If you perform an export from ICE just with CN entry names for user objects, you can run this through the linux AWK command with a bit of work to create an import file. I use awk in this way an awful lot.

For example, if I had a CSV file in the format:

userid,employeeid

then I'd do this:

awk 'BEGIN {FS=","; print "version: 1\n"} {print "dn: cn=" $1
",ou=orgunit,o=org\nchangetype: modify\nmodify: employeeID\nemployeeID: "
$2 "\n"}' < file.csv > file.ldif

This assumes that you have an attribute definition for employeeID associated with the user class. If you're using aux classes, then it's a little more involved because you need to add a value to the objectClass attribute for your aux class first.

This also assumes that all objects are in the same container. Changing the script to account for multiple containers is not very difficult to do, though.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell