Sunday, January 4, 2009

Bulk Importing Contacts using CSV file on Exchange 2007

Tested this script to import bulk contacts. Note that import will skip your csv contacts if display name column is empty for each contact. Parameter for Organizational Unit is the AD domain name and an AD OU container in this case, OU container name is mail contacts.


Import-Csv -path C:\Contacts\testcontact.csv ForEach { New-MailContact -Name $_.displayName -Firstname $_.Firstname -Lastname $_.Lastname -ExternalEmailAddress $_.Emailaddress -OrganizationalUnit "Domain.local/Mail Contacts" }


Here is a sample of the csv file

No comments: