Getting the number of mailboxes per database in your Exchange Organization

Share this:

How to create a single line PowerShell to retrieve the number of mailboxes per mailbox database in your organization. I was asked about that number in one of my customers and that was the reason behind of this Tutorial.

Solution


First, we need to identify the mailbox databases that we are looking to retrieve the number of mailboxes. In the current environment I have a considerable amount of databases spread all over my organization. That is simple, just using the cmdlet Get-MailboxDatabase.

image

The Exchange Management Console way…

If you are running Exchange Server 2010, you can use the traditional way which is creating a filter based on the mailbox database and that will generate a list of all mailboxes, and we can check the total number of mailboxes on the upper right side of the window.

image

 

The PowerShell way…

The solution is simple, just run the following command line and it will generate a list of all mailbox databases and the number of mailboxes hosted on each one of them.

Get-MailboxDatabase | foreach  { sleep 5; write-host; Write-Host (“The Mailbox Database ” + $_.Name + ” currently has ” + (get-mailbox -Database $_.Name).count + ” mailboxes hosted on it.”) }

image

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

How to remove the last Exchange Server 2013 from t... In a few situations you may want to remove the last Exchange Server 2013 and the setup process will give you a hard time for the Arbitration Mailboxes...
Running PowerShell on Mac OS PowerShell for everyone! In this Tutorial we are going the installation process on Mac OS.SolutionThe first step is to download the .pkg file which is...
Using Azure Resource Manager in PowerShell How to connect to Microsoft Azure PowerShell and use Azure Resource Manager deployment mode. Solution Microsoft Azure is a dynamic environment...
Performing Backup on your DHCP Server In this Tutorial we will be checking the process to protect the DHCP Server database using the automatic configuration, Graphical User Interface and P...