Solved

Importing LDIFs

Posted on 2008-06-26
13
244 Views
Last Modified: 2010-04-21
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)
0
Comment
Question by:Godbrain666
  • 7
  • 6
13 Comments
 
LVL 15

Expert Comment

by:fishadr
ID: 21875677
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
0
 

Author Comment

by:Godbrain666
ID: 21875811
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.
0
 

Author Comment

by:Godbrain666
ID: 21883369
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...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:fishadr
ID: 21883585
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!
0
 

Author Comment

by:Godbrain666
ID: 21884069
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?  
0
 
LVL 15

Expert Comment

by:fishadr
ID: 21884639
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
0
 

Author Comment

by:Godbrain666
ID: 21884715
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.
0
 
LVL 15

Expert Comment

by:fishadr
ID: 21884773
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.
0
 

Author Comment

by:Godbrain666
ID: 21886501
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.
0
 
LVL 15

Expert Comment

by:fishadr
ID: 21887759
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
0
 

Author Comment

by:Godbrain666
ID: 21926879
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.
0
 
LVL 15

Accepted Solution

by:
fishadr earned 200 total points
ID: 21931627
I write scripts using perl and vbscript, depending on what I need to do I will either use something like Excel to manipulate the data (as it is fast and powerful for this job). If there are complexities then I will create a quick script to read the data in to script and manipulate it out in the format that I want so that it can be imported using ldifde etc or I will load it straight in to AD.

There is no quick solution to this, you need to invest a little time learning Excel and scripting and then you will save administration time

The following has some good examples for you to manipulate data using scripts:
http://www.computerperformance.co.uk/vbscript/index.htm
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

and the following is reference information

http://msdn.microsoft.com/en-us/library/sx7b3k7y(VS.85).aspx
http://www.microsoft.com/technet/scriptcenter/guide/sas_vbs_overview.mspx?mfr=true

The following is also good VBscript reference:
http://www.w3schools.com/VBscript/default.asp
0
 

Author Closing Comment

by:Godbrain666
ID: 31470978
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!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question