PowerShell: Create Exchange Server 2016 Mailboxes in Bulk
December 8, 2017
![User Dialog User Dialog](https://eu-images.contentstack.com/v3/assets/blt07f68461ccd75245/blt83bef604bad942a3/6627723c00644ff88a1641c6/usernameandpassworddialog_4.jpg?width=850&auto=webp&quality=95&format=jpg&disable=upscale)
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(s)
You May Also Like