Exchange Online reporting

How to export Exchange Online mailbox sizes

Export mailbox sizes with PowerShell, use Microsoft's mailbox usage report, or run Altivane's Mailbox Sizes report for a workbook with storage and quotas.

By the Published Updated

To export Exchange Online mailbox sizes, collect mailboxes with Get-EXOMailbox, read their statistics with Get-EXOMailboxStatistics, and write the results to CSV. For a portal export, use Microsoft's Mailbox usage report. For repeat storage reviews, use Altivane's Mailbox Sizes report.

Choose the method that fits the job
MethodBest fit
PowerShellA custom CSV from current mailbox statistics.
Admin centreAn existing usage report with storage and quota information.
AltivaneRecommended for repeat reviews with sizes, quota flags and an Excel workbook.

Before you start

Choose the mailbox scope and record it with the export. The PowerShell example covers current user and shared mailboxes, not room, equipment, soft-deleted or inactive mailboxes. It reads primary mailbox statistics, not online archive sizes.

Use the Exchange Online PowerShell module and an account authorised to read the selected mailboxes and statistics. Check that you are connected to the intended tenant before running a collection.

Option 1

Export mailbox sizes with PowerShell

Install the module once, then run the collection. A failed mailbox read stops the example before it writes an incomplete CSV.

PowerShell
# Install once, if the module is not already installed.
Install-Module ExchangeOnlineManagement -Scope CurrentUser
PowerShell
$ErrorActionPreference = 'Stop'
Connect-ExchangeOnline
try {
    $types = 'UserMailbox','SharedMailbox'
    $mailboxes = Get-EXOMailbox -ResultSize Unlimited -RecipientTypeDetails $types
    $report = @(foreach ($mailbox in $mailboxes) {
        $statistics = Get-EXOMailboxStatistics -Identity $mailbox.UserPrincipalName
        [pscustomobject]@{
            DisplayName = $mailbox.DisplayName
            PrimarySmtpAddress = $mailbox.PrimarySmtpAddress.ToString()
            MailboxType = $mailbox.RecipientTypeDetails
            ItemCount = $statistics.ItemCount
            TotalItemSize = $statistics.TotalItemSize.ToString()
            RecoverableItemsSize = $statistics.TotalDeletedItemSize.ToString()
        }
    })
    if ($report.Count -eq 0) { throw 'No mailboxes returned. No CSV was written.' }
    $report | Export-Csv -Path './mailbox-sizes.csv' -NoTypeInformation -Encoding utf8
} finally {
    Disconnect-ExchangeOnline -Confirm:$false
}

The CSV includes the mailbox type, message count, primary size and Recoverable Items size. Size values are exported as Exchange's formatted text, so a text sort in Excel is not a numeric largest-first ranking. Use a numeric storage column from the usage report or Altivane when you need that comparison.

This example makes a statistics call for each mailbox, which can take time in a large tenant. An online archive needs a separate statistics read with -Archive; do not add primary and archive sizes together and compare the total with the primary mailbox quota.

Option 2

Export Microsoft's Mailbox usage report

  1. Open the Microsoft 365 admin centre with a role that can view usage reports.
  2. Go to Reports > Usage and select the Exchange reports.
  3. Open Email activity > View more, then choose Exchange > Mailbox usage from the report selector.
  4. Check the report date, mailbox type and selected columns. Review storage used and the warning, send and receive quotas.
  5. Choose Export to download the detailed usage data as CSV.

The report usually lags current activity by 24 to 48 hours. User names may be concealed by your organisation's reporting privacy setting. The Storage chart excludes online archives, and shared-mailbox chart summaries currently have an export limitation.

Common questions

Why do PowerShell and the usage report show different sizes?

They can represent different collection times and mailbox scopes. Compare the tenant, mailbox type, report refresh date and whether archives or Recoverable Items are included before deciding that either result is wrong.

Is every large mailbox close to its quota?

No. Compare size with that mailbox's actual quota. A smaller mailbox with a lower limit can need attention before a larger one with more capacity.

Does the export include every kind of mailbox?

The script deliberately includes current user and shared mailboxes only. Define a separate scope for inactive, deleted or resource mailboxes. You can also pair the review with the mailbox forwarding guide for a broader Exchange assessment.

Microsoft references

Technical references checked on 5 October 2026. The example script has been reviewed and syntax checked; it has not been run against a live tenant.

Talk to us about Altivane

Questions, or pricing? Get in touch.

Contact us