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.
| Method | Best fit |
|---|---|
| PowerShell | A custom CSV from current mailbox statistics. |
| Admin centre | An existing usage report with storage and quota information. |
| Altivane | Recommended 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.
# Install once, if the module is not already installed.
Install-Module ExchangeOnlineManagement -Scope CurrentUser$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
- Open the Microsoft 365 admin centre with a role that can view usage reports.
- Go to Reports > Usage and select the Exchange reports.
- Open Email activity > View more, then choose Exchange > Mailbox usage from the report selector.
- Check the report date, mailbox type and selected columns. Review storage used and the warning, send and receive quotas.
- 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.
Option 3 ยท Recommended for repeat storage reviews
Run Altivane's Mailbox Sizes report
- Open Altivane and choose the tenant.
- Run the Mailbox Sizes report for Exchange Online.
- Open the Excel workbook and review the size and quota tables, paying attention to mailboxes near or over quota and any collection errors.
The report orders mailboxes largest first and brings size, item count, quota use and Recoverable Items together. Archive-size collection depends on the configured settings. Last activity uses Microsoft Graph reporting data and needs Reports., so that part can have a different collection date from the Exchange statistics.
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.