For administrators managing an Exchange Online environment, understanding mailbox size distribution is not just a best practice; it is a critical operational necessity. The command "Get-Mailbox" combined with "Get-MailboxStatistics" within the Exchange Online PowerShell module provides the granular data required to monitor storage health. This process empowers IT teams to enforce quota policies, plan for storage expansion, and identify potential compliance risks before they escalate into larger issues.

Establishing the PowerShell Connection

Before you can execute any mailbox size analysis, you must first establish a remote session to Exchange Online. This requires the Exchange Online PowerShell Module, which can be downloaded directly from the Microsoft Admin Center. Once installed, the connection process involves importing the module and using administrative credentials to authenticate, ensuring you have the necessary RBAC roles to view mailbox statistics.
Connecting with Security and Compliance in Mind

It is highly recommended to use a dedicated Global Administrator or Compliance Management account for this task. This separation of duties enhances security and ensures that permission changes do not disrupt your ability to monitor the environment. Upon connecting, always verify the module version to ensure compatibility with the latest Exchange Online features.
The Foundational Command Syntax

The core of retrieving mailbox size data relies on combining two cmdlets: `Get-Mailbox` and `Get-MailboxStatistics`. The first cmdlet identifies the mailboxes, while the second pulls the specific storage metrics associated with each one. The standard approach involves piping the output of the mailbox command into the statistics command to generate a comprehensive report.
Decoding the Key Metrics
When you run the command, the resulting object contains specific properties that are essential for analysis. `TotalItemSize` represents the actual data within the mailbox, while `ItemCount` indicates the number of objects. Understanding the difference between `TotalItemSize` and `StorageQuota` is vital for identifying users who are approaching their limits.

| Property Name | Description | Use Case |
|---|---|---|
| TotalItemSize | The aggregate size of all mailbox items. | Identifying storage hogs. |
| ItemCount | The total number of items (emails, attachments). | Assessing content density. |
| DeletedItemSize | Space consumed in the dumpster. | Forensic recovery planning. |
| StorageQuota | The maximum limit assigned to the mailbox. | Compliance risk assessment. |
Advanced Filtering and Sorting Techniques
Running the command without parameters returns every mailbox in the tenant, which can be overwhelming. To make the data actionable, you should filter the results based on specific criteria. Sorting the data by size allows you to immediately focus on the accounts that represent the highest storage cost or risk.

Filtering by Database and Results
Large enterprises often host mailboxes across multiple databases. If you need to analyze a specific server or database, you can add the `-Database` parameter to narrow the scope. Furthermore, appending `| Sort-Object TotalItemSize -Descending` ensures that the largest mailboxes appear at the top of your report, allowing for immediate prioritization of cleanup efforts.


















Automating Reports for Proactive Management
Manual checks are insufficient for maintaining long-term storage hygiene. By wrapping the cmdlet in a script, you can schedule automated weekly or monthly reports. These reports can be exported to CSV files, emailed to the storage team, or integrated into a larger dashboard. This automation transforms a reactive task into a proactive management strategy, preventing surprise overages.
Interpreting the Data for Business Decisions
The data generated goes beyond simple arithmetic; it informs critical business decisions regarding archiving policies and user productivity. If a specific department consistently shows high mailbox sizes, it may indicate a need for better data governance training or the implementation of stricter retention policies. Treat this data as a diagnostic tool for organizational communication habits.