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

PowerShell Script to fix Exchange Server 2013 Secu... I wrote the following PowerShell script to help fixing the issue reported by Microsoft Exchange Team (http://blogs.technet.com/b/exchange/archive/2013...
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...
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...
Performing daily task with PowerShell to manage Hy... As a virtualization administrator, you will come across a lot of scenarios where you will need to create, modify, move, export, and other tasks to man...