Script to import contacts from CSV into Exchange GAL

create a .csv with the desired contacts, set column headings as follows:

Alias, DisplayName, Name, EmailAddress
save the file as contacts.csv and copy the file to the server.
start Exchange Management Shell and run the following script:
import-Csv "C:Contacts.csv" | ForEach-Object{
$displayname=$_.DisplayName
New-MailContact -Name $_.Name -ExternalEmailAddress $_.EmailAddress -Alias $_.Alias
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *