In any organization running Exchange 2016 or legacy versions like Exchange 2010 or 2013, you may get the request to get a count of all mailboxes in the environment.
This is quite easy to get when running a simple command from the Exchange Management Shell (EMS).
Launch the EMS and run the following command:
- (Get-Mailbox).count
As shown above, we only have 6 mailboxes so the above command will run without a warning, if you have more than 1000 mailboxes then you need to run the following command:
- (Get-Mailbox -Resultsize unlimited).count
Let’s take this a step further, you need to know which server has X number of mailboxes on, for that we can run the following command:
- Get-Mailbox | Group-Object -Property:ServerName | Select-Object name,count
As shown above, we can see how many mailboxes are on our 3 servers.
Hope it helps.