Key Points
- Collect Authoritative Mailbox Data: Run Get-MailboxStatistics in PowerShell to capture mailbox size, item counts, and last logon details directly from Exchange Online.
- Include Quota and Archive Info: Combine mailbox statistics with Get-EXOMailbox to surface quota limits, archive usage, and overall storage footprint.
- Target Folder Sampling for Large Mailboxes: Run Get-MailboxFolderStatistics on oversized or high-risk mailboxes to identify growth sources or retention issues.
- Normalize and Export Consistently: Convert sizes to GB, add metadata (tenant, timestamp, script version), and export to CSV or JSON for easy trend tracking.
- Automate at Scale with Safeguards: Use app-only auth, throttling control, and retry logic for unattended jobs across large or multi-tenant environments.
Mailbox size reports can help MSPs drive capacity planning, restore validation, and investigation timelines across Exchange Online environments. PowerShell provides direct, server-side metrics that reveal true mailbox size, item count, and archive usage without relying on client views.
This guide shows how to use Get-Mailboxstatistics and related Exchange Online cmdlets to produce accurate Office 365 mailbox size reports with PowerShell at scale for MSPs. This gives you information about how to include quote data, archive context, and folder-level sampling, then normalize results for automation, audits, and monthly QBRs.
Steps for getting Mailbox size reports with PowerShell at scale
Mailbox size reporting should pull server-side stats and quota context directly from Exchange Online. These reports will also support migration planning, enabling teams to exchange online mailbox migrations without downtime.
📌 Prerequisites:
- You will need the Exchange Online (EXO) PowerShell module and permissions to read mailbox properties and statistics.
- This requires secure credential storage or app-only authentication configured for unattended runs.
- You will need a central path where CSV, JavaScript Object Notation (JSON), and run logs are written consistently.
- This requires an optional list of target mailboxes for folder-level sampling during deeper analysis.
Step 1: Inventory mailbox sizes efficiently
Start by gathering mailbox statistics from Exchange Online to establish a clean reporting baseline. This step helps you capture size metrics and mailbox types for future quota, archive, and growth analysis.
📌 Use Cases:
- This creates an authoritative baseline using Get-MailboxStatistics for audits, QBRs, or tenant migrations.
- Distinguishes between user, shared, and resource mailboxes to support accurate quota and capacity planning.
📌 Prerequisites:
- You will need the Exchange Online PowerShell (EXO V3) module installed and have access to run mailbox statistics commands.
- This requires admin credentials or app-only authentication to connect securely to Exchange Online.
Step-by-step process:
- Connect to Exchange Online PowerShell.
- Run Get-MailboxStatistics and select only required fields such as TotalItemSize, ItemCount, LastLogonTime, and Database.
- Export results to CSV or JSON format as a baseline.
- Include a column for mailbox type to separate user, shared, and resource mailboxes.
- Store the export in a central location for comparison in later runs.
Step 2: Add quota and archive context
Enhance the baseline report by combining mailbox statistics with quota and archive details. This will provide visibility into storage usage, potential breaches, and the true mailbox footprint across the tenant.
📌 Use Cases:
- This helps identify users who are nearing quota limits or have exceeded thresholds.
- It provides full visibility into Exchange Online mailbox sizes by including archive mailbox data alongside primary storage.
📌 Prerequisites:
- You will need additional permissions to query mailbox properties using the Get-EXOMailbox cmdlet.
- This needs access to both mailbox statistics and property data to perform merges in PowerShell.
PowerShell command:
Get-EXOMailbox |
|
This retrieves quota and archive information from Exchange Online mailboxes to combine with Get-MailboxStatistics outputs for complete storage reporting.
Step 3: Optional folder-level sampling for depth
Folder-level sampling provides insight into mailbox growth patterns and helps explain why certain mailboxes consume more storage than expected.
📌 Use Cases:
- Analyzes which folders contribute most to mailbox size growth for accurate reporting and forecasting.
- Supports investigations into abnormal storage use, recovery folder buildup, or quota breaches.
📌 Prerequisites:
- You will need advanced rights to run Get-MailboxFolderStatistics across target mailboxes.
- This requires a baseline export that identifies the largest or most critical mailboxes.
PowerShell command:
$largest = (Import-Csv .\MailboxSize_Baseline.csv |
|
This command samples folder statistics from the largest mailboxes, capturing top folders and recoverable items to pinpoint growth sources and retention impact.
Step 4: Normalize, label, and store outputs
Normalizing mailbox size data creates consistent, comparable reports across tenants and reporting cycles.
📌 Use Cases:
- This converts mailbox size data to standardized units for accurate trend analysis.
- This lets you add metadata for audit tracking and dashboard integration.
📌 Prerequisites:
- You will need previous CSV or object data from earlier steps.
- This needs PowerShell environment access to manipulate and export CSV/JSON files.
PowerShell command:
$report = Import-Csv .\MailboxSize_Joined.csv | ForEach-Object {
|
This script converts mailbox sizes to gigabytes, adds labels for date, tenant, and script version, and exports the data to CSV and JSON for reporting or dashboards.
Step 5: Automate with safeguards
Automation ensures mailbox size reports run consistently without user interaction, minimizing throttling and transient fault risks across large Office 365 tenants.
📌 Use Cases:
- Enables unattended report generation across multiple tenants or environments.
- Provides reliable Exchange Online mailbox size monitoring with retry logic and versioned delta tracking.
📌 Prerequisites:
- You will need app-only authentication configured in Azure AD for noninteractive Exchange Online sessions.
- This needs a secure script repository and task scheduler to handle nightly or weekly runs.
Connect-ExchangeOnline -AppId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
|
This PowerShell step connects securely, applies retry logic to avoid throttling, and generates a delta comparison file for tracking mailbox growth and quota changes across reporting cycles.
Step 6: Multi-tenant rollups for MSPs
Rollups let MSPs combine results from multiple tenants into a single report for comparative analysis of client reviews.
📌 Use Cases:
- This produces a single dashboard showing the largest mailboxes, quota breaches, and archive usage by tenant.
- It simplifies QBR preparation by consolidating per-tenant outputs into a single, normalized dataset.
📌 Prerequisites:
- You will need an existing tenant configuration file that defines authentication details per tenant.
- This requires all previous reporting steps to be completed successfully and for their exports to be stored in a central location.
What to do:
- Loop tenants from a configuration file and authenticate per-tenant.
- Write each tenant’s output into its own folder with a consistent date stamp.
- Generate a combined rollup that shows the largest mailboxes, growth trends, quota breaches, and archive adoption across all tenants.
Step 7: Turn mailbox reports into measurable outcomes
Converting mailbox size data into follow-up tasks will ensure that the data leads to measurable outcomes.
📌 Use Cases:
- This opens proactive tickets for quota breaches, abnormal growth, or oversized shared mailboxes.
- It highlights monthly trends and exceptions in QBRs to demonstrate the maturity of capacity planning.
📌 Prerequisites:
- You will need the mailbox size and quota reports completed from the previous steps.
- To accomplish this step, you will need access to your PSA software or service desk to open and track remediation tickets.
What to do:
- Create tickets for high PercentQuotaUsed values, rapid mailbox growth, or oversized shared mailboxes.
- Attach relevant mailbox samples to restore or retention tests for verification.
- Include growth charts, quota breaches, and archive trends in monthly QBR packets to close the reporting loop.
⚠️ Things to look out for
Risks | Potential Consequences | Reversals |
| Missing authentication context in scheduled jobs | Automation fails silently or produces incomplete reports. | Use app-only authentication and test token validity before scheduling |
| Large exports without normalization | Report comparisons and trends become unreliable | Convert all mailbox sizes to GB and include consistent metadata fields |
| Incomplete or skipped tenant runs | Rollup shows inconsistent totals or missing tenants | Validate per tenant folders and record counts before compiling final reports |
Best practices summary table for obtaining mailbox size reports on PowerShell
Practice | Purpose | Value Delivered |
| Mailbox size baseline | Capture authoritative mailbox metrics with Get-MailboxStatistics | Accurate capacity data for forecasting and audits |
| Include quota and archive details | Combine usage data with quota thresholds and archive status for full visibility | Better capacity planning and fewer unexpected storage breaches |
| Folder-level sampling | Analyze folder statistics for large, fast-growing mailboxes | Quicker root-cause detection and improved retention management |
| Normalize and label outputs | Standardize mailbox data across tenants with consistent units and metadata | Easy comparisons, reliable trend analysis, and dashboard integration |
| Automate reporting securely | Use app-only authentication and scheduled scripts for recurring jobs | Scalable, secure, and consistent multi-tenant reporting |
Tasks to help streamline mailbox size reporting and quota tracking
Using automation and accomplishing these tasks ensures mailbox size reports stay consistent, accurate, and ready for audits or QBRs.
- Schedule a PowerShell job to export mailbox size and item counts with Get-MailboxStatistics.
- Merge quota details from Get-EXOMailbox and calculate PercentQuotaUsed to track usage and growth.
- Flag quota breaches and large-growth anomalies automatically in each run.
- Optionally sample folder statistics for the top 50 mailboxes to identify storage-heavy folders.
- Export CSV, JSON, and a summary log including record counts, runtime, and applied filters.
- Run a monthly comparison task to create delta reports and a one-page summary for documentation.
Scaling mailbox size reporting for MSP operations
Mailbox size reporting becomes a strategic process when Exchange Online PowerShell cmdlets are combined with quota and archive context, targeted folder sampling, and automation. Normalized outputs and monthly deltas provide a clear view of capacity trends and storage utilization across tenants.
By utilizing Get-MailboxStatistics and structured PowerShell mailbox size reports, MSPs can transform raw data into actionable planning insights, incident evidence, and QBR-ready summaries. This approach fosters operational consistency, minimizes surprises, and enables informed capacity and retention decisions across all client environments.
Related topics:
- How to Backup Microsoft 365 Exchange Online
- How to Protect Shared Mailboxes with Security Groups in Microsoft 365
- Email Archiving Strategies: Comprehensive Guide for IT Administrators and MSPs
- How to Migrate Exchange Online Mailboxes Without Downtime
- How to Use Microsoft Graph API to Pull Compliance Reports Across Multiple Tenants
