Managing Exchange servers inevitably leads to situations where you need to monitor mailbox sizes regularly. Whether you’re dealing with oversized mailboxes affecting server performance, hunting down storage hogs, or simply keeping tabs on storage quotas across your organization, knowing how to efficiently check mailbox capacity is essential.

Today I’ll walk you through various methods to check mailbox sizes in both on-premises Exchange Server and Exchange Online environments. These are tried-and-tested approaches that I’ve used countless times in production environments.

MS-Exchange-Server

 

 

1. PowerShell Commands: Mailbox Size Check, Management

PowerShell remains the most powerful and flexible way to check Exchange mailbox sizes. It works seamlessly across both on-premises Exchange Server and Exchange Online environments.

Checking Individual Mailbox Size

# Basic command
Get-MailboxStatistics -Identity "username" | Select-Object DisplayName, TotalItemSize, ItemCount

# Example
Get-MailboxStatistics -Identity "john.doe@contoso.com" | Select-Object DisplayName, TotalItemSize, ItemCount

Getting All Mailbox Sizes

# Get all mailboxes sorted by size
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | 
Select-Object DisplayName, TotalItemSize, ItemCount | 
Sort-Object TotalItemSize -Descending

Finding Your Top 30 Largest Mailboxes

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | 
Sort-Object TotalItemSize -Descending | 
Select-Object DisplayName, TotalItemSize -First 30

Exchange Online Optimized Commands

For Exchange Online, Microsoft recommends using the more efficient Get-EXOMailboxStatistics cmdlet:

# Connect to Exchange Online
Connect-ExchangeOnline -UserPrincipalName "admin@contoso.com"

# Individual mailbox query
Get-EXOMailboxStatistics -Identity "user@contoso.com" -Properties DisplayName,TotalItemSize,ItemCount

# All mailboxes query
Get-EXOMailbox -ResultSize Unlimited | Get-EXOMailboxStatistics

 

 

2. Making Sense of Mailbox Sizes: Converting to Human-Readable Formats

Raw PowerShell output shows mailbox sizes in bytes, which isn’t exactly user-friendly. Here’s how to convert them to more readable formats:

Converting to Megabytes

Get-MailboxStatistics | 
Select-Object DisplayName, 
@{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}}, 
ItemCount, StorageLimitStatus | 
Sort-Object "Total Size (MB)" -Descending

Converting to Gigabytes

Get-MailboxStatistics | 
Select-Object DisplayName, 
@{label="Total Size (GB)";expression={[math]::Round($_.TotalItemSize.Value.ToGB(),2)}}, 
ItemCount, StorageLimitStatus | 
Sort-Object "Total Size (GB)" -Descending

 

 

3. Filtering Mailboxes Based on Specific Criteria

Finding Mailboxes Larger Than 1GB

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | 
Where-Object {$_.TotalItemSize.Value.ToGB() -gt 1} | 
Select-Object DisplayName, 
@{label="Size (GB)";expression={[math]::Round($_.TotalItemSize.Value.ToGB(),2)}} | 
Sort-Object "Size (GB)" -Descending

Checking Specific Database Mailboxes

Get-MailboxStatistics -Database "Mailbox Database 01" | 
Select-Object DisplayName, TotalItemSize, Database | 
Sort-Object TotalItemSize -Descending

 

 

4. Using Exchange Admin Center (EAC) for GUI-Based Management

For admins who prefer graphical interfaces, here’s how to check mailbox sizes through the web interface.

On-Premises Exchange Server

  1. Access Exchange Admin Center
    • Navigate to https://yourserver/ecp or https://yourserver/exchange in your browser
    • Log in with administrative credentials
  2. View Mailbox Information
    • Click RecipientsMailboxes in the left navigation
    • Select the user you want to check
    • View mailbox usage in the details pane on the right

Exchange Online

  1. Access Exchange Admin Center
  2. Check Mailbox Capacity
    • Navigate to RecipientsMailboxes
    • Click on a user to see mailbox information in the right panel

 

 

5. Leveraging Microsoft 365 Admin Center

Exchange Online users can also check mailbox usage through the Microsoft 365 admin center.

Using Usage Reports

  1. Access Microsoft 365 Admin Center
  2. View Mailbox Usage
    • Go to ReportsUsage
    • Click Email activityView more
    • Select the Mailbox usage tab

 

 

6. Practical PowerShell Scripts for Real-World Scenarios

Generating Comprehensive Mailbox Reports

# Collect all mailbox information and save to CSV
$MailboxReport = Get-Mailbox -ResultSize Unlimited | ForEach-Object {
    $Stats = Get-MailboxStatistics $_.Identity
    [PSCustomObject]@{
        'Display Name' = $_.DisplayName
        'Email Address' = $_.PrimarySmtpAddress
        'Total Size (MB)' = [math]::Round($Stats.TotalItemSize.Value.ToMB(), 2)
        'Item Count' = $Stats.ItemCount
        'Database' = $Stats.Database
        'Storage Limit Status' = $Stats.StorageLimitStatus
        'Last Logon' = $Stats.LastLogonTime
    }
}

$MailboxReport | Export-Csv -Path "C:\Reports\MailboxSizeReport.csv" -NoTypeInformation -Encoding UTF8

Large Mailbox Alert Script

# Find mailboxes larger than 5GB
$LargeMailboxes = Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | 
Where-Object {$_.TotalItemSize.Value.ToGB() -gt 5} | 
Select-Object DisplayName, 
@{label="Size (GB)";expression={[math]::Round($_.TotalItemSize.Value.ToGB(),2)}}, 
Database, StorageLimitStatus

if ($LargeMailboxes) {
    Write-Host "Found large mailboxes (5GB+):" -ForegroundColor Yellow
    $LargeMailboxes | Format-Table -AutoSize
} else {
    Write-Host "No mailboxes larger than 5GB found." -ForegroundColor Green
}

 

 

7. Checking Archive Mailbox Sizes

If you’re using archive functionality, you’ll need to check those separately:

# Check archive mailbox size
Get-MailboxStatistics -Identity "user@contoso.com" -Archive | 
Select-Object DisplayName, TotalItemSize, ItemCount

# Get all mailboxes with archives enabled
Get-Mailbox -Archive | Get-MailboxStatistics -Archive | 
Select-Object DisplayName, TotalItemSize | 
Sort-Object TotalItemSize -Descending

 

 

8. Combining Mailbox Size with Quota Information

Getting the full picture means checking both current usage and configured quotas:

Get-Mailbox -ResultSize Unlimited | ForEach-Object {
    $Stats = Get-MailboxStatistics $_.Identity
    [PSCustomObject]@{
        'Display Name' = $_.DisplayName
        'Current Size (GB)' = [math]::Round($Stats.TotalItemSize.Value.ToGB(), 2)
        'Warning Quota' = $_.IssueWarningQuota
        'Send Quota' = $_.ProhibitSendQuota
        'Send/Receive Quota' = $_.ProhibitSendReceiveQuota
        'Storage Status' = $Stats.StorageLimitStatus
    }
} | Format-Table -AutoSize

 

 

Command Reference Comparison

Environment Exchange Server Exchange Online Purpose
Basic Query Get-MailboxStatistics Get-EXOMailboxStatistics Individual/all mailbox stats
Mailbox List Get-Mailbox Get-EXOMailbox Basic mailbox information
Archive Query Get-MailboxStatistics -Archive Get-EXOMailboxStatistics -Archive Archive mailbox statistics
Folder Stats Get-MailboxFolderStatistics Get-EXOMailboxFolderStatistics Detailed folder information

 

 

Performance Tips and Best Practices

When working with large Exchange environments, consider these optimization strategies:

For Large Environments

  • Use -ResultSize parameter to limit initial queries during testing
  • Consider running reports during off-peak hours
  • Break down large queries into smaller batches for better performance

Script Optimization

# More efficient approach for large environments
$Mailboxes = Get-Mailbox -ResultSize Unlimited
$Results = foreach ($Mailbox in $Mailboxes) {
    $Stats = Get-MailboxStatistics $Mailbox.Identity -ErrorAction SilentlyContinue
    if ($Stats) {
        [PSCustomObject]@{
            DisplayName = $Mailbox.DisplayName
            SizeGB = [math]::Round($Stats.TotalItemSize.Value.ToGB(), 2)
            ItemCount = $Stats.ItemCount
        }
    }
}

 

 

Monitoring Exchange mailbox sizes doesn’t have to be complicated. Whether you prefer the flexibility of PowerShell scripting or the simplicity of web-based admin centers, you now have a complete toolkit for staying on top of your email storage requirements.

Regular mailbox size monitoring helps maintain optimal server performance and ensures users have a smooth email experience. Pick the method that works best for your environment and make it part of your regular maintenance routine.

 

Leave a Reply