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

Managing Hyper-V Server remotely through PowerShel... Working with PowerShell can be very common for daily tasks and Hyper-V Server management. However, as there is more than one server to be managed, som...
Statistics of a NIC Teaming If the UI window is sufficiently tall a statistics tile appears at the bottom of the Team tile and the Adapters and Interfaces tile. These statistics ...
How to generate SMTP Address reports in your Excha... In this Tutorial we are going over two simple methods to create reports to list SMTP address. The first section will cover how to list all primary SMT...
Automating the process to join a server to a domai... In this Tutorial we are going to optimize a simple task that in larger environments may take some time from the service desk/operations team which is ...