Novell Home

From .CSV File to User Accounts - in Minutes

Novell Cool Solutions: Tip
By Charles Love

Digg This - Slashdot This

Posted: 5 Oct 2005
 

Problem

A customer wants to take a pre-formatted .CSV file and import it into eDirectory to create accounts.

Solution

Here's a quick tip on how to take a .csv file and turn it into eDirectory accounts via ICE.

I found lots of 3rd party utils out there, but this way seems to be pretty easy. In my case, the customer already had a .csv file with title, name, email, password, etc. All I needed to do was make some GroupWise Accounts. So I imported the CSV (700 Users in about one minute), then I added them to the PO under the membership tab (about two minutes). And that's it! We created 700 accounts with phone numbers, departments, first name, last name, etc. - everything we wanted. Quickly, I may add!

Here is how I did it ...

First, I needed a stage file in /tmp/order.csv - this is the file where you map 1-to-1 the fields you want imported. You can do more or less than this if you want.

###########/tmp/order.csv file###########
dn,cn,title,sn,mail,fullname,telephoneNumber,facsimileTelephoneNumber,ou,givenName,l,userPassword
###########/tmp/order.csv file###########

Next, I needed the .csv import file. I used openoffice to play with the columns to put them in the right place to match the stage file. Here is a sample of one line of my in.csv file:

###########/tmp/in.csv file###########
clove,Charles,Technical Services Manager,Love,charles@bigsurtech.com,Charles J. Love,813-123-4567,813-987-6534,Big Sur Technologies Inc, Charles, tampa,Password
###########/tmp/in.csv file###########

Then I went to the console (NetWare 6.5 SP4, in my case) and ran the following:

########### type on console###########
ice -S DELIM -f/tmp/in.csv -F /tmp/order.csv -ncn -lou=users,o=tampa -D LDAP -s 192.168.1.x -p389 -d cn=root,o=tampa -w pass
########### type on console###########

Note: Instead of "-lou=users,o=tampa" you need to change to the location where you want the objects to go. For "192.168.1.x", change to the IP of your eDirectory box. For "cn=root,o=tampa -w pass", change to your admin ID and Password.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell