Updated 5 months ago

Export Office 365 Mailbox Size Report Using PowerShell

by Kathy Cooper

4 min read

No Comments

As an admin, it is an important task to periodically monitor Office 365 mailbox size and quotas. Else, it will end up in error like ‘mailbox size limit exceeded,’ ‘unable to send/receive messages due to mailbox quota,’ etc.

So, how will you check the mailbox size in Office 365? You can use either the Exchange admin center or PowerShell to get a mailbox usage report. But the Exchange admin center can show limited information only. With PowerShell, you can get a detailed mailbox size report. However, you need to combine multiple cmdlets like Get-Mailbox, Get-MailboxStatistics, etc.

To ease your work, we have created a handy PowerShell script to export mailbox size and quotas to a nicely formatted CSV file.

Download Script: GetMailboxSizeReport.ps1

Script Highlights:

  • Exports mailbox size report for all mailboxes.
  • Retrieves mailbox size for list of mailboxes (import CSV)
  • Allows to use filter to get user mailboxes’ size alone
  • Allows to use filter to get shared mailboxes size alone.
  • Automatically installs the EXO PowerShell module (if not installed already) upon your confirmation.
  • The script can be executed with MFA enabled account too.
  • Exports report results to CSV.
  • The script is scheduler friendly.
  • Supports certificate- based authentication (CBA) too.

Office 365 Mailbox Size Report – Sample Output:

The exported mailbox size usage report looks like screenshot below:

mailbox size report office 365

The exported mailbox size and quota report contains following attributes:

  • Display Name
  • User Principal Name
  • Mailbox Type
  • Primary SMTP Address
  • Item Count (Emails, Attachments, Calendar events, etc.)
  • Total Item Size
  • Is Archived
  • Deleted Item Count
  • Total Deleted Item Size
  • Issue Warning Quota
  • Prohibit Send Quota
  • Prohibit Send and Receive Quota

Note: You can refer to the Archive mailbox size report to know more about mailboxes’ archive-related information like archive status, size, archive quota, etc.

How to Export Mailbox Size Report to CSV?

Step 1: Download the script.

Step 2: Start Windows PowerShell as Administrator.

Step 3: Since the script supports both MFA enabled account and non-MFA account, it requires a different approach for each method. To run this script, you can choose any one of the below methods.

Method 1: Execute script with MFA and non-MFA account.

Method 2: Execute script by explicitly mentioning credential (Scheduler friendly).

You can use the above format to schedule the script in Windows Task Scheduler or Azure Automation using non-MFA account. If the account has MFA, you can disable MFA using CA policy for the particular account.


Method 3
: Execute the script using Certificate-based Authentication (CBA).

You can adopt this approach when you want to run the script unattended. This method is also scheduler-friendly.

Note: As this method connects to Exchange Online with certificate, you must register an app in Azure AD before running the script.

More Use-cases of ‘Office 365 Mailbox Usage Statistics Report’

The script supports advanced filtering params which, helps you to get the report as per your need.

Get Office 365 Shared Mailbox Size Report:

To get shared mailbox size report, quotas, and size warning, you can run the script with SharedMBOnly param.

The exported shared mailbox usage size report contains mailbox storage size, quotas, and mailbox size warning. By referring to this report, admin can increase the mailbox size.

Get User Mailbox Size Report:

To check the size of user mailboxes, you can execute the script with UserMBOnly param.

The output contains mailbox storage statistics like total item size, item count, deleted item count, mailbox size limits, quota status, etc.

Get Mailbox Usage Size Report for a List of Mailboxes:

You can use MBNamesFile param to check mailbox size from the input list called “MBNames.txt.”

To get the storage size of specific mailboxes, pass an input file with a Display Name/ Alias/ Distinguished Name/ Canonical DN/ Email Address or GUID of Shared Mailboxes.

The mailbox names CSV File must follow the format below: Identity of mailboxes separated by new line without a header.

List all Mailboxes Sorted by Mailbox Size:

To get the top list of big mailboxes (I.e., sorted by mailbox size), run the script, and open the report with Excel. And then, sort the ‘Total Size (Bytes)’ column. Now, you can see the mailbox size report that is sorted by mailbox storage size.

Office 365 Mailbox Quota Report:

By default, the script exports mailbox quota report. Quota information includes issue warning quota, prohibit send quota, and prohibit send & receive quota. By referring to this data, you can increase the mailbox size and the quota.

Automate Exchange Mailbox Used Size Report:

Since this script is scheduler-friendly, you can schedule a script in Windows Task Scheduler by explicitly mentioning the credential or use the Certificate-based Authentication.

Get More Detailed Mailbox Usage Reports:

Are you tired of dealing with the complexities of PowerShell scripts just to get detailed mailbox size reports in Microsoft 365? Say goodbye to the pain of manual efforts! Introducing AdminDroid’s Microsoft 365 reporting and auditing tool, a hassle-free solution that empowers you with comprehensive Exchange Online reports and usage insights.

AdminDroid provides detailed mailbox usage report based on

  • Mailbox size
    • Mailbox size and the storage-used percentage
    • Mailbox size over time
    • Mailbox over warning quota
    • Mailbox quota statistics
  • Email activity
    • Daily mail read/sent/received count by users
    • Overall email traffic
    • Daily Exchange active user count by activity
    • Mail statistics
  • Email app usage
  • Archive mailbox size

In addition to these reports, AdminDroid offers 450+ Exchange Online reports which are designed to simplify mailbox auditing and email monitoring. AdminDroid’s Exchange Online auditing reports cover a wide range of critical aspects, empowering you to gain deep insights into Exchange Online activities. Make your Exchange Online Management efficient with AdminDroid.

Exchange Online mailbox size report

Exchange Online mailbox usage dashboard

And that’s not all! AdminDroid goes above and beyond by providing 1800+ pre-built reports and 30+ smart dashboards to know about your Office 365 environment at a glance. This tool provides reports on Office 365 reporting, auditing, analytics, usage statistics, security & compliance, etc. Download and simplify your Office 365 management with AdminDroid today!

I hope this blog is useful to check the mailbox size and quota report. If you have any queries, reach us through the comment section.

Share article