PowerShell Code: Get Mailboxes with Size Greater Than X

Today, I’ll show you another classic PowerShell Code for Exchange Server that will let you search for users with a mailbox size of X and above.

I came across the need to do this when I had to rebalance mailboxes on Exchange Server and wanted to know which users have mailboxes over 5GB.

The code below. Will show you all the mailboxes with total size of 5GB and above on a specific database.

get-mailbox -database mbx01 | Get-MailboxStatistics | where {$_.TotalItemSize -ge 5GB}

To search all the mailboxes In the organization use the code below:

get-mailbox -resultsize unlimited | Get-MailboxStatistics | where {$_.TotalItemSize -ge 5GB}