Luckily, there's a cmdlet for that. Create a CSV file where the first line reads as follows:
Name,ExternalEmailAddress,OrganizationalUnit
Subsequent lines should look like this:
John Doe,SMTP:johnny@example.com,contoso.info/In/This/OU
Jane Doe,SMTP:janey@example.com,contoso.info/In/That/OU
The finished product should look like this:
Name,ExternalEmailAddress,OrganizationalUnit
John Doe,SMTP:johnny@example.com,contoso.info/In/This/OU
Jane Doe,SMTP:janey@example.com,contoso.info/In/That/OU
(Of course, add as many entries as you like)
Got that in a CSV file? Good. Save it somewhere and fire up PowerShell on your Exchange server. Then, run the following:
import-csv Book1.csv | foreach {New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -OrganizationalUnit $_.OrganizationalUnit -whatif}
Edit the file name as needed. I threw in the "-whatif" part so that you can see exactly what the command will do before actually doing it. As long as you like the results, you can take out the "-whatif" to go ahead and create the objects.
No comments:
Post a Comment