Import-MailContactsFromCSV.ps1 is a PowerShell script to automate the creation of Exchange mail contacts using a CSV file for input.
The current version of the script supports a CSV file containing the following fields, which are the minimum details required for creating a mail contact in Exchange:
The script looks for a file named Contacts.csv by default, or you can use the optional -CSVFileName parameter to specify your own file name. You can also set a default OU for contacts in the script, or use the -OU parameter to specify an OU.
C:ScriptsImportContacts>.Import-MailContactsFromCSV.ps1 C:ScriptsImportContacts>.Import-MailContactsFromCSV.ps1 -CSVFileName externalcontractors.csv C:ScriptsImportContacts>.Import-MailContactsFromCSV.ps1 -OU "exchangeserverpro.net/Company/Contacts"
If you are providing this script to a non-administrator to use, you can configure an RBAC custom role to limit their permissions to only allow them to create contacts in a specific OU, as demonstrated here.