Tuesday, 29 December 2015

Counting Exchange Server 2010 Total Mailboxes with Exchange management shell

For an Exchange administrator there are a lot of different situations in which they may need to know how many mailboxes are in the organization.  Fortunately this is made easy in Exchange Server 2010 with a few simple EMS commands.


To get a count of all mailboxes in the Exchange 2010 organization use the following command:
(Get-Mailbox).count
 
Note that if you know your organization has over 1000 mailboxes you need to make sure that the result size of the command output is not limited.
(Get-Mailbox -resultsize unlimited).count
 
Next, we can get a count of mailboxes per Exchange 2010 mailbox server.
Get-Mailbox | Group-Object -Property:ServerName | Select-Object name,count

We can also get a count of mailboxes per database in the Exchange organization.
Get-Mailbox | Group-Object -Property:Database | Select-Object name,count

As you can see the Group-Object command allows us to see a count of mailboxes based on different attributes or properties of the mailbox. For example a count of mailboxes that are and are not exempt from email address policies.
Get-Mailbox | Group-Object -Property:EmailAddressPolicyEnabled | Select-Object name,count

And as a final example, a count of mailboxes by Office (notice that the 6 mailboxes with a null value are still included in the results).
Get-Mailbox | Group-Object -Property:Office | Select-Object name,count 
 
 

No comments:

Post a Comment