Commands › Exchange Online

Get-MailboxStatistics

Exchange Online ExchangeOnlineManagement Get-*

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)

ParameterTypeRequiredWhat it controls
-Identity GeneralMailboxOrMailUserIdParameter yes The Identity parameter specifies the mailbox that you want to return statistics for. You can use any value that uniquely identifies the mailbox. For example:
-StoreMailboxIdentity StoreMailboxIdParameter This parameter is available only in on-premises Exchange.
-Archive SwitchParameter The Archive switch specifies whether to return mailbox statistics for the archive mailbox that's associated with the mailbox. You don't need to specify a value with this switch.
-CopyOnServer ServerIdParameter This parameter is available only in on-premises Exchange.
-Database DatabaseIdParameter yes This parameter is available only in on-premises Exchange.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Filter String This parameter is available only in on-premises Exchange.
-IncludeMoveHistory SwitchParameter The IncludeMoveHistory switch specifies whether to return additional information about the mailbox that includes the history of a completed move request, such as status, flags, target database, bad items, start...
-IncludeMoveReport SwitchParameter The IncludeMoveReport switch specifies whether to return a verbose detailed move report for a completed move request, such as server connections and move stages. You don't need to specify a value with this switch.
-IncludePassive SwitchParameter This parameter is available only in on-premises Exchange.
-IncludeSoftDeletedRecipients SwitchParameter This parameter is available only in the cloud-based service.
-IncludeQuarantineDetails SwitchParameter This parameter is available only in on-premises Exchange.
-NoADLookup SwitchParameter This parameter is available only in on-premises Exchange.
-Server ServerIdParameter yes This parameter is available only in on-premises Exchange.
-UseCustomRouting SwitchParameter This parameter is available only in the cloud-based service.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.