December 4, 2012

Exchange 2010 - Getting mailbox Sizes

How to get list of huge mailboxes in Exchange 2010 via PowerShell?

Information can be obtained from Mailbox server or Database:
Get-MailboxServer -identity ServerName | Get-MailboxStatistics
Get-Mailbox -database DatabaseName | Get-MailboxStatistics 

Mailboxes with more than 5Gb size:
Get-MailboxServer -identity ServerName | Get-MailboxStatistics | Where {$_.TotalItemSize -ge 5GB} | sort-Object TotalItemSize -descending | Select-Object DisplayName,ItemCount,@{name=”MailboxSize”;exp={$_.totalitemsize}}

Also output can be saved in CSV file using:
export-csv C:\filename.csv

As result: 
Get-MailboxServer -identity ServerName | Get-MailboxStatistics | Where {$_.TotalItemSize -ge 5GB} | sort-Object TotalItemSize -descending | Select-Object DisplayName,ItemCount,@{name=”MailboxSize”;exp={$_.totalitemsize}} | export-csv C:\filename.csv

No comments:

Post a Comment