Commands › Exchange Online
Get-MailboxStatistics
Return information about a mailbox, such as the size of the mailbox, the number of messages it contains, and the last time it was accessed. In addition, you can get the move history or a move report of a completed move request. **Note**: In Exchange Online PowerShell, we recommend that you use the Get-EXOMailboxStatistics cmdlet instead of this cmdlet. For more information, see Connect to Exchange Online PowerShell.
Quick start script
# Get-MailboxStatistics — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Run and inspect
Get-MailboxStatistics -Identity <GeneralMailboxOrMailUserIdParameter> -Database <DatabaseIdParameter> -Server <ServerIdParameter> | Format-List
# 3. Export for evidence / drift tracking
Get-MailboxStatistics | Export-Clixml .\MailboxStatistics-$(Get-Date -Format yyyyMMdd).xml
Syntax — 3 parameter sets
Database
Get-MailboxStatistics -Database <DatabaseIdParameter> [[-StoreMailboxIdentity] <StoreMailboxIdParameter>]
[-CopyOnServer <ServerIdParameter>]
[-DomainController <Fqdn>]
[-Filter <String>]
[-IncludeMoveHistory]
[-IncludeMoveReport]
[-IncludeQuarantineDetails]
[-NoADLookup]
[<CommonParameters>]
Identity
Get-MailboxStatistics [-Identity] <GeneralMailboxOrMailUserIdParameter>
[-Archive]
[-CopyOnServer <ServerIdParameter>]
[-DomainController <Fqdn>]
[-IncludeMoveHistory]
[-IncludeMoveReport]
[-IncludeQuarantineDetails]
[-IncludeSoftDeletedRecipients]
[-NoADLookup]
[-UseCustomRouting]
[<CommonParameters>]
Server
Get-MailboxStatistics -Server <ServerIdParameter>
[-DomainController <Fqdn>]
[-Filter <String>]
[-IncludeMoveHistory]
[-IncludeMoveReport]
[-IncludePassive]
[-IncludeQuarantineDetails]
[-NoADLookup]
[<CommonParameters>]
Parameters (15)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.