PowerShell: Create Exchange Server 2016 Mailboxes in Bulk
December 8, 2017
This Exchange Server 2016 article focuses on creating multiple user mailboxes with the help of CSV file and PowerShell.
Step One: Create a Users CSV File
You need to have a list of user mailboxes in CSV file. You can create a file with the help of Microsoft Excel or any notepad editor. Use the following format; the header is important.
DisplayName,FirstName,LastName,UserPrincipalName
For example:
DisplayName,FirstName,LastName,UserPrincipalName
RabiaBuzdar,Rabia,Buzdar,[email protected]
Once the file is ready, save it with .csv extension suppose CreateMailboxes.csv.
Step Two: Import the CSV File and Creating the Mailboxes
Open PowerShell with administrative privileges and execute the following command to read the password for new user mailboxes.
$Password=Read-Host “Enter Password” –AsSecureString
When you are done reading the password, create user mailboxes with the help of following command.
Import-CSV | ForEach {New-Mailbox -Name $_.name -firstname $_.firstname -lastname $_.lastname -userPrincipalName $_.userprincipalname -OrganizationalUnit Users -Password $Password}
You are done.
About the Author
You May Also Like