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 and logon Scripts In this Tutorial we are going over the process to create a logon script using PowerShell and that will work for all systems running at least Windows S...
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...
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...
How to.. list Mailbox Databases from previous vers... If you run Get-MailboxDatabase in an Exchange Server 2013 you will receive a list of all your Mailbox Databases running on Exchange Server 2013 which ...