Bulk Mailbox creating mailboxes in Exchange 2010 multi-tenant

I recently received this email in my inbox so I thought it would be a good idea to dedicate a post answering this question.

Hi Antoine,

First of all, I’d like to thank you for you blog, I used your guide to set up an Exchange 2010 multi tenant set up and it worked like a dream! Very clear instructions, just what I needed to guide us through the potential minefield!

Do you have any blog posts or examples on how to bulk create mailbox in a multi tenant environment, I’d like to a take a spreadsheet with users name, e-mail address etc. and create multiple mailboxes using a powershell script. I’m a GUI man at heart and I find powershell tricky at the best of times. I saw your blog on how to import PST files which I also think will be very useful.

Any help you can offer would be greatly appreciated.

Before getting started, and if you are new to Exchange 2010 multi-tenant mode I suggest you check the list of tutorials I wrote : Exchange 2010 hosting for hosters.

Lab Setup

For this tutorial I am using a single exchange server in hosting mode running all the roles, but the number of exchange servers you have in your setup will not change anything.

I have also created 2 test organizations for this tutorial TestOrg1 and TestOrg2.

A look to the CSV file


We need to build a comma separated value file containing all the info about the mailboxes to be created. Here is what my CSV file looks like

First,Last,Organization,Alias,UPN,Password
John,Doe,TestOrg1,jdoe,[email protected],[email protected]
Jane,Mcneel,TestOrg1,jmcneel,[email protected],[email protected]
Mark,Seamons,TestOrg2,mseamons,[email protected],[email protected]
Tiffany,Michelle,TestOrg2,tmichelle,[email protected],[email protected]

As you can see I tried to keep it as minimal as possible you can, of course, add as much information as you need.

Bulk Importing

It is now time to use the above created CSV file and populate your organization. Here is the powershell script to run

Import-Csv C:\List.csv | % {
  $name = $_.first + " " + $_.last; 
  New-Mailbox -Name $name -Alias $_.Alias -Organization $_.organization -FirstName $_.first -LastName $_.last -UserPrincipalName $_.upn -password (ConvertTo-SecureString $_.password -AsPlainText -Force)
}

Well that’s all about it, hope this will be helpful in your deployments

I have been working in IT consultancy and solution integration since 1998 and I consider myself lucky to be, one in a few, making a living out of my passion. I am also member of the famous Experts Exchange (profile here) online community where I try my best to share what I have learned along the road.

Posted in Messaging & Collaboration Tagged with: , , , ,
4 comments on “Bulk Mailbox creating mailboxes in Exchange 2010 multi-tenant
  1. Dj says:

    Nooooooooo not the hosted verision. That thing is Gone with the wind.
    http://blogs.technet.com/b/exchange/archive/2011/10/13/future-of-hosting-mode.aspx

  2. Richard Butler says:

    Great, thanks for this, very helpful! Hope my request can help others out too.

  3. artiq says:

    Great Thanks, working with  Hosting Switch, but how can i use this script in Exchange 2010 SP2 Multi-Tenant Mode

Leave a Reply to Dj Cancel reply

Your email address will not be published. Required fields are marked *

*