Problem

A Forum reader recently asked:

“I have a list of the entire OU structure in an Excel document. I want to do an LDIF import of the OU structure, creating each OU for me. How can this be done? “

And here are suggestions from Edward van der Maas and Aaron Burgemeister …

Solution

Edward van der Maas

Create something like this:

version: 1

dn: ou=org1,o=Novell
changetype: add
ou: org1
objectClass: organizationalUnit
objectClass: ndsLoginProperties
objectClass: ndsContainerLoginProperties
objectClass: Top
objectClass: Partition

dn: ou=org2,o=Novell
changetype: add
ou: org2
objectClass: organizationalUnit
objectClass: ndsLoginProperties
objectClass: ndsContainerLoginProperties
objectClass: Top

Aaron Burgemeister

It depends on what the Excel document has it in specifically, and in what format, and how complete it is. You may be able to use ICE (Import Convert Export) via ConsoleOne or iManager (or even the command line) to import directly from a CSV format, but I would prefer to create an LDIF from the file. Excel equations could be used to create the LDIF, as follows:

A1, ouShortName
B1, ouContext
C1, ="dn: " + A1 + "," + B1 + vbCrLf + "changetype: add" + vbCrLf + "ou:
" + A1 + vbCrLf + "objectClass: organizationalUnit" + vbCrLf +
"objectClass: ndsLoginProperties" + vbCrLf + "objectClass:
ndsContainerLoginProperties" + vbCrLf + "objectClass: Top" + vbCrLf + vbCrLf

In case it is not apparent, the ‘vbCrLf’ is supposed to create a new line. This would create an LDIF similar to the one Edward created as an example, and would only require you have the short name of the OUs in one column and the context for them in another (on the same row). The forumla could then be “filled down,” and you could copy/paste the entire thing to a file (that entire third column, I mean) and run it.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
netiqcoolguys
Mar 14, 2007
3:40 am
Reads:
934
Score:
Unrated