Creating multiple mailboxes using Exchange Management Shell

Share this:

In Today’s Tutorial we are going over a simple task which is to create several mailboxes using Exchange Management Shell. This Tutorial may be useful when creating a LAB and the same principle can be used for Distribution Groups and several other objects and the same applies to create Active Directory users for example.

Solution


The first step  is to define the initial password to all new mailboxes, let’s run the following cmdlet and on the new dialog box we need to make sure that we type in the desired password in the Password field. By the way, the User Name field it doesn’t matter so we just need to type something on it.

$Password = (Get-Credential).Password

image5

Now, it’s time to use a single line to create as many mailboxes as you want. Using the cmdlet listed below we can control the number of mailboxes (in the example we are creating 10 users, if you want 50, just change the 10 to 50). Also, we are adding a prefix for the new mailboxes (in the example we are using Argentina), and the UPN for the new mailboxes (in our example is @apatricio.info.

ForEach ($vNumber in 1..10) { New-mailbox (“Argentina” + $vNumber) –Password $Password –OrganizationUnit <OU-Path> –Database <Database-Name> –UserPrincipalName (“Argentina” + $vNumber +”@apatricio.info”) }

Note: The OrganizationUnit and Database are not mandatory ;

Time to see the cmdlet in action, and in the example bellow we are creating 10 users in the Argentina OU, and all the users start with Argentina.

image2

If you are skeptical about the process, you can always check the Exchange Management Console (Exchange Server 2010) or Exchange Admin Center (2013) to check it out the new mailboxes created.

image8

Conclusion


In this Tutorial we covered a simple cmdlet that allows any administrator to create several mailboxes using the same password using a single line in Exchange Management Shell.

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

Error Property InvalidDatabaseCopiesAllowed In some scenarios when creating a Mailbox Database the error below may appear. This Tutorial was based on Exchange Server 2013 Service Pack 1 (CU4). P...
Fixing the issue: Cannot find E-discovery arbitrat... In Today’s post we are going over an error where the Exchange Server 2013 installation returns these following error messages: Cannot find E-discove...
Exchange Server 2013 SP1– Architecture Poster Hello folks, The Exchange Team released a new version of the Architecture Poster with all Service Pack 1 details. To download it use this following l...
How to.. list Mailbox Databases from previous vers... If you run Get-MailboxDatabase in an Exchange Server 2013 you will receive a list of all your Mailbox Databases running on Exchange Server 2013 which ...