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

Managing DAG: Creating a new DAG using EAC At this point of the series we created a DAG witness server, pre-staged the Active Directory that will be used by the DAG in this Tutorial and last bu...
Error: Parameter name collection during Edge Trans... If you are using the built-in scripts to clone Edge Transport configuration in Exchange Server 2013 you may encounter this following error when runnin...
How to… access EAC after installing the first Exch... As soon as you introduce your first Exchange Server 2013 in your organization you first action may be trying to logon on ECP/EAC to get access however...
How to prepare Active Directory separately in Exch... In this Tutorial we are going over the process to prepare Active Directory which is a required step when deploying the first Exchange Server 2013 Serv...