Articles and Ideas

Inspecting Mailbox sizes and Quota limits

Posted by:

Inspecting Mailbox sizes and Quota limits

When reviewing Exchange configuration it is always recommended to query for all mailboxes in all databases on all storage groups. It is especially useful during the storage consolidating process or when inspecting user mailboxes load. I was asked to evaluate migration to Exchange 2013 hardware prerequisites and this process came pretty handy.

Simple Get-MailboxStatistics cmdlet will give you the basic information about mailboxes but I wanted to inspect a bit more in-depth information sorted (exported) in Excel where I could easily manipulate with Excel data formatted as table.

I needed the following information:

  1. Display name (Full users name)
  2. Alias (used for primary SMTP address)
  3. Is Use database quota defaults turned on (or that mailbox has its own quota limits defined and active)
  4. If defined, what are the quota limits and warnings
  5. Total mailbox size including the number of items in each mailbox
  6. Storage group and Database on which each mailbox reside

Then I wanted everything exported to Excel using Export-Csv cmdlet.
When exporting to Excel, CSV file often shows garbage or its missing data if cmdlet’s in Exchange Management Shell (EMS) are not properly used. That’s when I have discovered few simple and important facts you need to follow:

  1. In large scale companies with many Exchange servers hosting different roles it is always best to run Mailbox queries on Exchange server hosting Mailbox role or, if designed for high data availability, on Clustered Mailbox Server (CMS), which is my scenario.
  2. TotalItemSize value actually has built-in mechanisms to convert from bytes (which is default output value) into other units. Just use corresponding ToString() method. See syntax below.
  3. To get ItemCount to work properly (if showing garbage or not at all) just use the @{label=”ItemCount”;expression={(get-mailboxstatistics $_).ItemCount}} instead of just stating ItemCount object in your query.
  4. Remember to use -NoTypeInformation switch on Export-Csv cmdlet since you will arrange data in Excel and also don’t forget to nail correct encoding format with -Encoding switch if you have special characters in data being analyzed.

Load that MailboxSizes.CSV file from C:\Temp into Excel and format it as table and save it in Excel native format (*.xlsx for Excel 2010).


I always use Count subtotal command for either DisplayName or Alias columns counting mailboxes for all displayed (or filtered) Databases and Sum subtotal command for TotalItemSize(MB) column summing storage space used by all displayed (or specific filtered) Database.

Since I always use this file in my reports I always need storage space calculated in GB’s and in human readable form. That’s why I use the following Excel functions to round up MB’s into GB’s with two decimals in the TotalItemSize(MB) Sum cell:

That way you can monitor storage space of your Exchange organization, quota limits, specific user mailboxes and technically plan future business needs.


Predrag Mirjanić

About the Author:

I am capable of working as an engineer on complicated projects or as a "one-man band" bringing the project from scratch to successful fruition. Regarding my technical skills I have quite a lot to offer. Primarily I am a Systems Administrator (Engineer). I have acquired experience in the field by installing, implementing and administering many different Microsoft based network setups in large ICT environments, in diverse industry and government companies. I am familiar with older operating systems including Linux/UNIX based systems. I have designed, installed and implemented different technologies like: Exchange, IP CCTV, BES, SCCM (specifically ZTI), network QoS optimization, and much more. I have good experience with virtualized environments (Microsoft based). I can apply my skills to help automate processes in order to reduce administrative overheads and/or human errors. I am in process of developing WAMP based (Windows, Apache, MySQL and PHP) intranet (company-wide) social networking site for document and project management purposes. Engineering hardware based cloud (powered by Linux OS) for purposes of rendering video material. Also programming several different RouterOS based MikroTik routers to deliver ultimate network management solution (QoS, bandwidth control, L7 protocol traffic control etc.).

Add a Comment