Export User Data from AD to Outlook's Address Book

Learn how to import information from the GAL into Outlook Contacts.

Readers

June 22, 2003

2 Min Read
ITPro Today logo


Outlook's Global Address List (GAL), which the systems administrator maintains, contains details about users and contacts. If you use Messaging API (MAPI) to connect to your Exchange Server server, users can browse the GAL and select addressees from the list. If you use IMAP4 or POP3 to connect, you can use Lightweight Directory Access Protocol (LDAP) to access the GAL—but you can't easily download the GAL's contents into Outlook Contacts as you can with MAPI. Outlook Contacts is useful when you're working out of the office or using Outlook in offline mode.

As the Microsoft articles "How to Use Csvde.exe to Import Contacts into Active Directory" (http://support.microsoft.com/?kbid=300409) and "XADM: Bulk Import/Export FAQ" (http://support.microsoft.com/?kbid=155414) explain, you can use various Microsoft tools to export Active Directory's (AD's) data to a text file. Although these tools create a file, they don't complete the process of importing data into Outlook Contacts.

Thus, you must use Outlook's Import and Export Wizard to manually update Outlook Contacts. The simplest way to update Outlook Contacts is to import information from a comma-separated value (.csv) file. This file format is preferable because by default, Outlook's Import and Export Wizard uses the comma to separate the GAL's information.

First, you must automatically prepare a .csv file and import the file to Outlook Contacts. To complete this step, you must run a program that uses AD data to create the .csv file. For this task, I use the VBScript program ExportContacts.vbs, which Listing 1 shows. This program connects to AD and creates the .csv file. I use a system account to run ExportContacts.vbs on my server. You need to change two of the script's parameters for your environment: domain name and file path. The script works with Outlook 2000, Outlook 98, and Outlook Express.

Second, use the AT command to schedule the program to run on the server. For example, the command

AT \servername 8:00 /every:M,T,W,Th,F d:exportcontacts.vbs

will run the script on the server at 8:00 a.m. Monday through Friday.

Third, you must determine how remote users will receive the updated .csv file. You can store the .csv file on the network as a shared file, send it by email, or publish it on the internal corporate Web site.

Fourth, import the contacts from the .csv file in Outlook Contacts. From Outlook's File menu, select Import. Select Import from another program or file and click Next. Select Comma Separated Values (Windows) and click Next. Finally, you need to select a folder in which to store the contacts. The best solution is to create a separate Contacts folder in Outlook to hold your corporate contacts. To prevent duplicate contacts, erase all the contacts in this folder before importing the contacts from the .csv file.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like