Create a .CSV file with this format:
Save it as contacts.csv. For the purpose of this guide, I have saved it to D:\contacts.csv
Also, make sure you have the Organizational Units (OUs) created in your Active Directory before proceeding. If not, you will get an error in Step 3.
Launch Exchange Management Shell.
Once it launches, type the following code:
Import-Csv D:\contacts.csv | ForEach-Object { New-MailContact -Name $_."Name" -ExternalEmailAddress $_."Email" -FirstNa
me $_."FirstName" -OrganizationalUnit $_."Oupath" -Alias $_."Alias" }
Hit Enter and you are done!
(header image source: freecodesource.com)