Exchange 2007 – Create Multiple Mailboxes using Powershell

We were recently setting up a test lab with an old version of Exchange 2007 to replicate a customers environment and we had created the required 250 users in Active Directory using some scripts but we also had to then create the mailboxes for these accounts. Not wanting to sit there manually creating all these […]

Exchange 2007 Create Multiple Mailboxes Using Powershell

We were recently setting up a test lab with an old version of Exchange 2007 to replicate a customers environment and we had created the required 250 users in Active Directory using some scripts but we also had to then create the mailboxes for these accounts.

Not wanting to sit there manually creating all these mailboxes, we used a quick Powershell command that had it done in 30 seconds.

Exchange Management Shell

All you need to do is to run the following command in your Exchange Management Shell (EMS):

Get-User -OrganizationalUnit "LAB/Users" | Where-Object{$_.RecipientType -eq "User"} | Enable-Mailbox -Database "LABMBXMBX1"

where:

  • “LAB/Users” – The OU you want to enable the mailboxes on
  • “LABMBXMBX1” – your Exchange database where you want to create the mailboxes on

You can also add further parts to your command to scale down the search for users based on Company or Department etc. To this, just add it to the “Where-Object” part – so an example:

Get-User -OrganizationalUnit "LAB/Users" | Where-Object{$_.RecipientType -eq "User" -and $_.department –eq "Sales" -and $_.company -eq "Lab Company"} | Enable-Mailbox -Database "LABMBXMBX1"

Just change the Sales and Lab Company to whatever you require.

Once you have run this command you should check in your Exchange Management Console and you should then see all the mailboxes that have been created for you.

FAQ

What does EMS stand for?

EMS stands for Exchange Management Shell

Will this work with newer versions of Exchange?

Although we have not tested it, it should work on more recent versions of Microsoft Exchange.

Feedback

If you have any feedback or queries on this guide, please leave us a message below and we will get back to you when we can.

More Guides You Might Have Missed

⬇️

Get the download

Exchange Toolkit Panel v1.1 is available as a free download.

Download Now →
🛠️

Gear We Recommend

Testing configs is easier with a dedicated admin machine set up right. Here’s the kit we use.

Browse our Windows Admin Toolkit picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.