PowerShell: Create Exchange Server 2016 Mailboxes in Bulk

Karim Buzdar

December 8, 2017

1 Min Read
User Dialog

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

powershellmailboxesinbulk1_0.png

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}

powershellmailboxesinbulk2_0.png

You are done.

About the Author

Karim Buzdar

https://www.linkedin.com/in/karimbuzdar/

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like