To find shared mailboxes near 50 GB in Exchange Online, list the shared mailboxes with Get-EXOMailbox, read each one's size with Get-EXOMailboxStatistics and keep those at or over a warning size, such as 45 GB. A shared mailbox without a licence is limited to 50 GB: at the limit it soon stops sending, and later stops receiving.
| Method | Best fit |
|---|---|
| PowerShell | A CSV of shared mailboxes over a size you choose, largest first, with their quota. |
| Admin centre | A one-off export of Microsoft's mailbox usage report, sorted in Excel. |
| Altivane | Recommended for regular reviews, with each mailbox rated against the 50 GB limit and its licence needs. |
Before you start
Use an account in the Organization Management or Recipient Management role group, which Microsoft lists for mailbox settings. The admin centre method needs a role that can view usage reports, such as Reports Reader.
A shared mailbox can store up to 50 GB without a licence. An Exchange Online Plan 2 licence raises the limit to 100 GB, and an archive or litigation hold also needs a licence. Unlicensed shared mailboxes created before July 2018 have 100 GB, so read each mailbox's own quota. The script reads sizes as they are when it runs. The examples read and export; they change nothing.
Option 1
Find shared mailboxes near 50 GB with PowerShell
Install the module once, then connect and export the shared mailboxes at or over $warnGB. It reads each mailbox's statistics in turn.
# Install once, if the module is not already installed.
Install-Module ExchangeOnlineManagement -Scope CurrentUser$ErrorActionPreference = 'Stop'
$warnGB = 45
Connect-ExchangeOnline -ShowBanner:$false
try {
$query = @{ RecipientTypeDetails = 'SharedMailbox'; ResultSize = 'Unlimited' }
$properties = 'ProhibitSendReceiveQuota', 'ArchiveStatus', 'LitigationHoldEnabled'
$shared = @(Get-EXOMailbox @query -Properties $properties)
$report = @(foreach ($mailbox in $shared) {
$identity = $mailbox.UserPrincipalName
if (-not $identity) { throw "No user principal name for $($mailbox.DisplayName)." }
$bytes = $null
try {
$size = "$((Get-EXOMailboxStatistics -Identity $identity).TotalItemSize)"
if ($size -match '\(([\d,]+) bytes\)') { $bytes = [int64]($Matches[1] -replace ',') }
} catch {
Write-Warning "The size of $identity couldn't be read: $($_.Exception.Message)"
}
if ($null -ne $bytes -and $bytes -ge $warnGB * 1GB) {
[pscustomobject]@{
Mailbox = $mailbox.DisplayName
Address = $mailbox.PrimarySmtpAddress.ToString()
SizeGB = [math]::Round($bytes / 1GB, 2)
Quota = "$($mailbox.ProhibitSendReceiveQuota)"
Archive = $mailbox.ArchiveStatus
LitigationHold = $mailbox.LitigationHoldEnabled
}
}
})
if ($report.Count -eq 0) {
Write-Output "No shared mailbox is at or over $warnGB GB."
} else {
$report | Sort-Object SizeGB -Descending |
Export-Csv -Path './shared-mailboxes-near-limit.csv' -NoTypeInformation -Encoding utf8
Write-Output "$($report.Count) shared mailboxes are at or over $warnGB GB."
}
} finally {
Disconnect-ExchangeOnline -Confirm:$false
}The CSV has 1 row for each shared mailbox at or over the size, largest first, with its own quota. The script reads the byte count Exchange gives in brackets in TotalItemSize, so the result does not depend on how the size is rounded. Change $warnGB to widen or narrow the list. A mailbox whose size cannot be read is named in a warning and left out.
Check a single mailbox
Reconnect with Connect-ExchangeOnline, then read 1 shared mailbox's size and quota. The export above disconnects when it finishes.
# Run while connected to Exchange Online. Replace the example mailbox.
Get-EXOMailboxStatistics -Identity 'shared@example.com' |
Select-Object DisplayName, TotalItemSize, ItemCount
Get-EXOMailbox -Identity 'shared@example.com' -Properties ProhibitSendReceiveQuota |
Select-Object DisplayName, ProhibitSendReceiveQuotaOption 2
Review shared mailbox sizes in the admin centre
- Open the Microsoft 365 admin centre for the correct tenant.
- Go to Reports > Usage, and under Reports select Exchange.
- On the Email activity tab, select View More, then choose Exchange > Mailbox usage from the list.
- Choose Export to download the usage of every mailbox as a CSV file.
- In Excel, filter the recipient type to shared mailboxes and sort by storage used, largest first.
This suits a one-off look. Usage reports run a day or more behind, and they do not say whether a mailbox has a licence. To see that, find the mailbox under Users > Active users, where a shared mailbox with no licence shows as Unlicensed.
Option 3 ยท Recommended for regular reviews
Run Altivane's Shared Mailboxes report
- Open Altivane and choose the tenant.
- Set the shared mailbox size warning, 45 GB by default.
- Run the Shared Mailboxes report for Exchange Online. It is marked Slow because it reads each mailbox in turn.
- Open the Excel workbook and read the table of the same name, largest first, with Status, Size (GB), Quota (GB), Licensed, Archive and Litigation hold.
- For a list of only the large ones, run the Shared Mailboxes Near the Size Limit sample workflow, which writes those at or over a size to Excel.
Each shared mailbox without a licence is rated against its licence needs: Critical when it is over 50 GB, and Warning when it is over the size warning, has an archive or is on litigation hold. The table also says whether the account can sign in, and when the mailbox was last used. The workflow changes nothing.
Contact usCommon questions
What happens when a shared mailbox reaches 50 GB?
Microsoft says it can still receive email for some time but cannot send new email. After that it stops receiving too, and senders get a non-delivery report. Assign an Exchange Online Plan 2 licence to raise the limit to 100 GB, or remove large items to bring it under 50 GB.
Why does a mailbox show a 100 GB quota without a licence?
Unlicensed shared mailboxes created before July 2018 were given 100 GB. The script and Altivane read each mailbox's own quota, so they show the limit that applies to it.
Can people sign in to a shared mailbox directly?
A shared mailbox has a user account with a password the system set, and that account is active until you block it. To check every shared mailbox, see how to check shared mailbox sign-in in Exchange Online.
Microsoft references
Technical references checked on 6 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.