A mailbox storage report should tell you which mailboxes are largest and how many items they contain. Check primary and archive usage separately before combining the results.
Check one primary mailbox
Connect to Exchange Online PowerShell and substitute the mailbox address. ItemCount and TotalItemSize describe the store you queried.
Get-EXOMailboxStatistics -Identity user@contoso.com |
Select-Object DisplayName, ItemCount, TotalItemSizeCheck the archive
For an active archive, add the switch to the statistics command itself. Selecting users who have an archive is only the first step.
Get-EXOMailboxStatistics -Identity user@contoso.com -Archive |
Select-Object DisplayName, ItemCount, TotalItemSizeExport the report
This example writes one row per store in the current directory. The address and Store columns let you compare a user’s two rows. TotalItemSize is exported as displayed text. Sorting that text alphabetically will not rank mailboxes by size.
$mailboxes = Get-EXOMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited -Properties ArchiveStatus
$rows = foreach ($mailbox in $mailboxes) {
$address = $mailbox.PrimarySmtpAddress.ToString()
$stores = @('Primary')
if ($mailbox.ArchiveStatus -eq 'Active') { $stores += 'Archive' }
foreach ($store in $stores) {
$params = @{ Identity = $address; ErrorAction = 'Stop' }
if ($store -eq 'Archive') { $params.Archive = $true }
try {
$stats = Get-EXOMailboxStatistics @params
[pscustomobject]@{ Address = $address; Store = $store; Items = $stats.ItemCount; Size = $stats.TotalItemSize }
} catch {
Write-Warning "Could not read $store for $address. $($_.Exception.Message)"
}
}
}
$rows | Export-Csv -Path ./MailboxStorage.csv -NoTypeInformationCheck the warnings and compare one user’s CSV rows with the individual queries above. A missing row does not mean the mailbox contains no data.