Solved

Importing LDIFs

Posted on 2008-06-26
13
238 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
To show how to create a transport rule 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 >> Rules tab.:  To cr…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now