Friday , August 7 2020

How to Check Mailbox Size and ItemCount in Bulk – Exchange 2010

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

image

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

 

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Migration Endpoint Fails with Connection Exception

Solution –  Make sure Outlook Anywhere succeeds with test account. Make sure you enter the …

5 comments

  1. Good One Sathesh. Keep going

    • Satheshwaran Manoharan

      Thanks Sunder !!

      • hello Satheshwaran ,

        Could you please tell me how can Export to html or csv .

        Thank you .

        • Satheshwaran Manoharan

          [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”

Leave a Reply

Your email address will not be published.