Legacy Syntax (Exchange 2007/2010)
Get-MailboxServer "EXCHANGE-SERVER-NAME" | Get-MailboxStatistics | Select DisplayName,TotalItemSize | Sort TotalItemSize
Modern Syntax (Exchange 2013+ / Exchange Online)
Piping throughGet-MailboxServer is server-specific and doesn’t translate well to newer deployments (particularly Exchange Online, where there’s no on-prem mailbox server to target). A more broadly compatible command is:
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,TotalItemSize,ItemCount | Sort TotalItemSize -DescendingThis pulls every mailbox in the organisation (or swap
Get-Mailbox for Get-Mailbox -Database "DB-NAME" to scope it to one database) and sorts largest-first, which is usually the more useful order when you’re hunting for space hogs.
Exchange Online Equivalent
If you’re connecting to Exchange Online specifically rather than a hybrid or on-prem environment, the modern EXO-prefixed cmdlets are Microsoft’s recommended, REST-backed, throttling-friendlier option:Connect-ExchangeOnline Get-EXOMailbox -ResultSize Unlimited | Get-EXOMailboxStatistics | Select DisplayName,TotalItemSize,ItemCount | Sort TotalItemSize -DescendingThe legacy
Get-Mailbox/Get-MailboxStatistics pair still works against Exchange Online too, so either approach is functional — but for larger tenants or scripted/scheduled reporting, the EXO cmdlets are the better long-term choice since they’re less likely to hit throttling limits on big result sets.
A Quicker Single-Mailbox Check
If you just need one mailbox’s size rather than the whole organisation, skip the fullGet-Mailbox pipe entirely:
Get-MailboxStatistics -Identity "[email protected]" | Select DisplayName,TotalItemSize,ItemCount
Resources
Gear We Recommend
A few general tech accessories worth having alongside this.
Browse our General Tech Accessories picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.