You can use a short one liner Command to get the mailbox size have added | more in the end of the command so that you can press enter to proceed with a big list
you can remove it if you wish to export it.
To Check for the local Server –Â
Get-Mailboxdatabase | Get-MailboxStatistics | Sort TotalItemSize -descending | FT Displayname, TotalItemsize, Itemcount,Database –Autosize | more
 To Check for Database Level –Â
Get-Mailbox –Database “Database Name” | Get-MailboxStatistics | Sort TotalItemSize -descending | FT Displayname, TotalItemsize, Itemcount,Database –Autosize | more
 To Check for Server Level –
Get-Mailbox –Server “Server Name” | Get-MailboxStatistics | Sort TotalItemSize -descending | FT Displayname, TotalItemsize, Itemcount,Database –Autosize | more
To Export to CSV –
Get-Mailbox -Database “*04? | Get-MailboxStatistics | Sort TotalItemSize -descending | Export-Csv C:\MailboxSize-Descending.csv
Hope its Useful !!
Check this Script as well –
Mailbox Size Report for Exchange 2010/2013/2016 & Office 365
Good One Sathesh. Keep going
Thanks Sunder !!
hello Satheshwaran ,
Could you please tell me how can Export to html or csv .
Thank you .
[PS] C:Windowssystem32>Get-Mailbox -Database “*04” | Get-MailboxStatistics | Sort TotalItemSize -descending | Export-C
sv C:MailboxSize-Descending.csv
Problem is, Get-MailboxStatistics output just a display name – not unique and cant really be used as such. The other half of the information you need is in Get-Mailbox :- found answer in following link. once you have the data on all your mailboxes, and the output can be IMPORTED into excel you can do all your sorting etc and delete whatever you dont want
***if this is what you were looking for, please click this link and give the guy some credit.. i didnt come up with this, i just found it
#REM http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_27828458.html
$Mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($Mailbox in $Mailboxes)
{
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “MailboxSizeMB” -Value ((Get-MailboxStatistics $Mailbox).TotalItemSize.Value.ToMb())
}
$Mailboxes | Sort-Object MailboxSizeMB -Desc | Select PrimarySMTPAddress, MailboxSizeMB
#REM – to export this out — do the following 😉 enjoy (see the part where it says “Select” you can add additional fields like ALIAS etc to this)
$Mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($Mailbox in $Mailboxes)
{
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “MailboxSizeMB” -Value ((Get-MailboxStatistics $Mailbox).TotalItemSize.Value.ToMb())
}
$Mailboxes | Sort-Object MailboxSizeMB -Desc | Select PrimarySMTPAddress, MailboxSizeMB | Export-Csv -NoType “C:\temp\Mailboxessize.csv”