How to create bulk contact list from CSV file.

1. From the Source Exchange Server, create the CSV file. Go to the source Exchange Management Console, and navigate to Recipient Configuration and Mailbox. Right click on the Mailbox and choose View and Add/Remove Columns. From the list of columns that is available, choose all the columns that you may think you need. csv1

2. Go to the source Exchange Management Console, and navigate to Recipient Configuration and Mailbox. Right click on the Mailbox and Select Export List option.

Exchange1

3. Make sure to choose Text (Comma Delimited) (*.csv) option from from the Save as type drop down box. Save the file on the drive.

exchange2

4. Open the created text file using the notepad. Change headings section, so the headings do not contain any spaces.  So, “Display Name” becomes “DisplayName” and “Primary SMTP Address” becomes “PrimarySMTPAddress” and so on. Do this only on the heading, not on the content of the list.

Exchange3

5. Send the File to the destination Exchange Server and save it on the destination server. (In the example below, we will use the path c:\temp\Email.csv)

6. Open the Exchange Management Shell, and run the following script from the destination server.

The first script is used to create the contacts.

Import-Csv c:\temp\Email.csv | ForEach-Object {New-MailContact -Name $_.DisplayName -ExternalEmailAddress $_.PrimarySMTPAddress -Alias $_.Alias}

Run the script to populate the contacts with other details such as phone number, departments, position title etc.

Import-Csv c:\temp\Email.csv | ForEach-Object {   set-contact -identity $_.DisplayName -city $_.City -Company $_.Company -Department $_.Department -FirstName $_.FirstName -LastName $_.LastName  -Phone $_.Phone -StateorProvince $_.stateorprovince -Title $_.title}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s