Export Mailbox Sizes to CSV in Office 365

Timothy Aug 03, 2026

Optimizing your Office 365 workspace often involves keeping track of mailbox sizes, especially in larger organizations. Exporting mailbox sizes to a CSV format allows for easier monitoring, analysis, and troubleshooting. Here, you'll learn how to achieve this, ensuring a seamless, productive, and organized Outlook experience.

USPS, ADA, FHA Compliance, and Requirements for Mailboxes
USPS, ADA, FHA Compliance, and Requirements for Mailboxes

Before we dive in, ensure you're using Exchange Online and have the appropriate permissions. Additionally, you'll need to use PowerShell's `Get-MailboxStatistics` cmdlet, which retrieves mailbox statistics, including size information.

Best Ways to Import PST to Office 365 Mailbox - 2019 Guide
Best Ways to Import PST to Office 365 Mailbox - 2019 Guide

Preparations for Export

Navigating to your Office 365 portal, proceed to the Exchange Admin Center. Here, you'll begin your PowerShell journey to export mailbox sizes.

Export MBOX Mailbox to PDF
Export MBOX Mailbox to PDF

Before executing any commands, ensure your PowerShell session is in the correct mode: connect to Exchange Online using the `Connect-ExchangeOnline` cmdlet, and import the Exchange Online PowerShell snapshot using `Import-Module -Name ExchangeOnlineManagement`.

Identifying Mailboxes

Office 365: Unable to Access Shared Mailbox
Office 365: Unable to Access Shared Mailbox

First, let's find all the mailboxes in the organization using the `Get-Mailbox` cmdlet:

``` Get-Mailbox -ResultSize Unlimited | Select-Object Name,RecipientTypeDetails ```

This query returns a list of mailboxes along with their recipient types.

Filtering Results

Convert Password Protected Access MDB File To CSV Format
Convert Password Protected Access MDB File To CSV Format

You might need to filter your results based on specific criteria. For instance, to retrieve only enabled mailboxes, use:

``` Get-Mailbox -ResultSize Unlimited | Where-Object {$_.IsEnabled -eq $true} | Select-Object Name,RecipientTypeDetails ```

Extracting Mailbox Sizes

Once you've identified the mailboxes, proceed to gather their size information.

Microsoft Outlook Contacting the Server for Information [Fixed]
Microsoft Outlook Contacting the Server for Information [Fixed]

Utilize the `Get-MailboxStatistics` cmdlet and pipe the output to export to a CSV file:

``` Get-MailboxStatistics | Select-Object DisplayName,TotalItemSize, ItemCount | Export-Csv -Path "C:\ExchangeMailboxes.csv" -NoTypeInformation ```

The CSV File: columns and sizes

Mail merge to labels or envelopes in SoftMaker Office 2024
Mail merge to labels or envelopes in SoftMaker Office 2024
How to Print Multiple Emails From an Outlook Folder
How to Print Multiple Emails From an Outlook Folder
How To Convert OST file to PST Format? - Kadva Corp
How To Convert OST file to PST Format? - Kadva Corp
How to Auto-Archive Emails in Outlook to Free Up Mailbox Space
How to Auto-Archive Emails in Outlook to Free Up Mailbox Space
a woman sitting in front of a red mailbox with a laptop on her lap
a woman sitting in front of a red mailbox with a laptop on her lap
Veeam Backup Office 365 - Sauvegarder vos données Microsoft Office 365
Veeam Backup Office 365 - Sauvegarder vos données Microsoft Office 365

The resulting CSV file, located in your specified path, will contain three columns: 'DisplayName', 'TotalItemSize', and 'ItemCount'. The 'TotalItemSize' represents the total size of all items in the mailbox, including attachments, in bytes.

For instance, if the size is large (say, 10GB), the value in the 'TotalItemSize' column will be approximately 10737418240 bytes, as 1 GB = 1073741824 bytes.

Cleaning Up

Once finished, disconnect your PowerShell session from Exchange Online with the `Disconnect-ExchangeOnline` cmdlet.

There you have it! You've successfully exported your Office 365 mailbox sizes to a CSV file, empowering you to manage your mailboxes more efficiently.

Regularly checking and monitoring these mailbox sizes keeps data usage in check, preventing any potential storage issues. Happy administering!