In this article will lets you how to report or count mailboxes per database in Exchange server 2010/2013/2016/2019 using PowerShell scripts.
PowerShell for Mailbox count per database in Exchange
Run Exchange Management Shell as administrator and use Get-Mailbox cmdlet.
Get-Mailbox -ResultSize Unlimited | Group-Object -Property:Database | Select-Object Name, Count | Sort-Object Name | Format-Table
This cmdlet lets you know how many mailboxes are in each Exchange database.
PowerShell for Mailbox count of a specific database in Exchange
Get-Mailbox -ResultSize Unlimited -Database "DBEX01" | Group-Object -Property:Database | Select-Object Name, Count | Format-Table
This cmdlet lets you know how many mailboxes are in a specific Exchange database.
Related Articles:
Find How Many Emails Sent and Received from Exchange Server
Message Trace in Exchange Online Office 365
Exchange Mailbox (.edb) Recovery Tools
Conclusion
Hope the above given PowerShell script will lets easily and efficiently to report or count mailboxes per database in Exchange server 2010/2013/2016/2019.