Link to home
Start Free TrialLog in
Avatar of Godbrain666
Godbrain666

asked on

Importing LDIFs

I have received an LDIF from our parent company, and am trying to figure out the best way to import it into Exchange 2003 (rather than a suggested method of importing it into everyone's Outlook individually).  Is there a way to import them into the GAL without creating each person as a contact?  The only information we truly need this for is to be able to look up a person's phone number, and of course, the ability to call up e-mail addresses within Outlook.

Here's a (modified) sample:

dn: CN=Lastnam Firstnam (FLASTNAM), OU=TST, OU=Users, OU=Secretlands, DC=comp
 any,DC=com
telephoneNumber: 555 555 1212
mail: FLASTNAM@company.com
givenName: Firstnam
sn: Lastnam
cn: Lastnam Firstname (FLASTNAM)
Avatar of fishadr
fishadr
Flag of United Kingdom of Great Britain and Northern Ireland image

You have to import the external users as contacts in Active Diectory, you cannot import them to Exchange 2003. If you hide them from the GAL then users will not be able to view them and find them in Outlook. If you import them as contacts they will be displayed with a different icon, I also tend to import nad place (External) next to the name so that this identifies them as external contacts to the users.

http://support.microsoft.com/kb/327620

http://book.itzero.com/read/microsoft/Prentice.Hall.PTR.Windows.Server.2003.on.HP.ProLiant.Servers.Oct.2004.eBook-DDU_html/0131467581/ch10lev1sec3.html
Avatar of Godbrain666
Godbrain666

ASKER

Is there anything I should know while trying to import since the domain names are different?  I've looked into it before, and I think LDIFDE won't support changing things such as DC, but I believe CSVDE needs the file to be in a CSV format, which this is not.  I'm *really* not very good at scripting, but I certainly don't want to import 2,000 contacts by hand.
I've toyed around a bit with LDIFDE and CSVDE, and it seems that I can't get either to work with the data I currently have.  *EVERY* entry is the same format and information that is listed in the example... it seems as if I would have to modify the data /greatly/ in order to be able to use either tool to import that data back in.  

It just seems like there should be an easier way, since Outlook Express can import that data very, very easily...
You will more than likely have to manipulate the data prior to importing this. However this is not normally as bad as it may seem.

You can use Notepad to do a search for specific parts of the text and then replace it
ie. with the following:
dn: CN=Lastnam Firstnam (FLASTNAM), OU=TST, OU=Users, OU=Secretlands, DC=company,DC=com

You could do a search for:
OU=TST, OU=Users, OU=Secretlands, DC=comp any,DC=company,DC=com
and replace with:
OU=ExternalContacts, OU=LiveDomain, DC=LiveDC,DC=Live,DC=com

You can also import the csv in to Excel and merge cells using Concatenate etc (Check help in Excel)

It is not that bad!
I've created a few small tests, and just can't seem to get it to go with LDIFDE... I'll try to merge everything using Excel and see if CSVDE has any more luck.

The issue I'm having right now seems to be some kind of syntax error.  Can anyone see anything wrong with the syntax of it (It says line 3, which in the one I'm working with would be the MAIL line).  Is the syntax used in this file good for *either* LDIFDE or CSVDE?  Or should I ask for another export using these tools?  What would the filters be to get *just* the information I would need for contacts?  
Try the following:

dn: cn=LastName\, FirstName,ou=Contacts,dc=myDomain,dc=co,dc=uk
changetype: add
objectclass: contact
cn: LastName, FirstName
sn: LastName
givenName: FirstName
DisplayName: LastName, FirstName

Replace the LastName, FirstName with real names and set the correct ou and dc options on the 1st line
Well... although I'm 99% certain the example given would work... I'd basically be recreating the entire file, which contains about 1,500 contacts.  I would basically be scrapping the LDIF I currently have.  In the end, it seems like I would be better off just creating each contact manually.
I have done this quite a few times, you can edit the file in Excel and use the search and replace options along with concatenate options to merge information such as firstname and lastname etc in to a new column and then paste the lot in to a new file and import.

It might take you a short time to get used to manipulting the data but once you have it mastered it will only take you a few minutes the next time.

The manual option is not a good idea - it will take you ages.
Strange... my last post didn't show up...

My main concern at this point is that doing it this way will make a non-mail enabled contact with no phone number, so I would still have to manually edit everything.  Is there a "find and replace" for doing those as well?  I've looked at importing it into Excel, and the file I have has a 77-character "break" (COMP at the end of line one is the beginning of "COMPANY" which continues on line 2).  So first, I'd have to manually go through the document deleting two spaces to put that all on one line again, THEN import everything, THEN try to figure out how to use Excel in the way you described.  I just can't see how this is *less* work than simply printing out the list and creating each one manually... or even importing the LDIF into Outlook.
You can import pretty much anything including the phone numbers in to AD.

Using Excel you can do some pretty clever checking for data and joining it or replacing it from certain points. I would be suprised that if you spent a short time learning the manipultion part you would be able to convert the file within five to ten minutes. Once you get your head round it, it is pretty striaght forward and the whole process will be much faster than manual addition.

The following article has some good examples of manipulating data in Excel.
http://blogs.msdn.com/excel/archive/2007/11/12/manipulating-and-massaging-data-in-excel.aspx
From what I've seen, there may be a better solution through some scripting that will import the data "as is".  Does anyone have any further input on this topic?  After looking at the file, the amount of data manipulation needed for this current solution is prohibitive when weighed against the time savings I would gain by not manually entering each user instead.
ASKER CERTIFIED SOLUTION
Avatar of fishadr
fishadr
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Although the answer wasn't 100% what I was hoping for, it's as good of an answer as I'm going to get.  I appreciate all the help.  Wish me luck!