Commands › Exchange Online

Get-EXOMailboxStatistics

Exchange Online ExchangeOnlineManagement Get-*

For more information, see About the Exchange Online PowerShell module. Use the Get-EXOMailboxStatistics cmdlet to 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.

Quick start script

# Get-EXOMailboxStatistics — 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-EXOMailboxStatistics | Format-List

# 3. Export for evidence / drift tracking
Get-EXOMailboxStatistics | Export-Clixml .\EXOMailboxStatistics-$(Get-Date -Format yyyyMMdd).xml

Syntax

Get-EXOMailboxStatistics
 [-Archive]
 [-DatabaseGuid <Guid>]
 [-ExchangeGuid <Guid>]
 [-Identity <String>]
 [-IncludeMoveHistory]
 [-IncludeMoveReport]
 [-IncludeSoftDeletedRecipients]
 [-PrimarySmtpAddress <String>]
 [-Properties <String[]>]
 [-PropertySets <PropertySet[]>]
 [-UserPrincipalName <String>]
 [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Archive SwitchParameter The Archive switch specifies whether to return mailbox statistics for the archive mailbox associated with the specified mailbox. You don't need to specify a value with this switch.
-DatabaseGuid Guid The DatabaseGuid parameter filters the results by the GUID of mailbox database that hosts the Mailbox. You can find this property value by using the Get-EXOMailbox cmdlet with the Properties parameter value DatabaseGuid.
-ExchangeGuid Guid The ExchangeGuid parameter filters the results by the GUID of mailbox (aso known as the Mailbox GUID). You can find this property value by using the Get-EXOMailbox cmdlet with Properties filter set to ExchangeGuid.
-Identity String The Identity parameter specifies the mailbox you want to view. For the best performance, we recommend using the user ID or user principal name (UPN) to identify the mailbox.
-IncludeMoveHistory SwitchParameter This parameter is reserved for internal Microsoft use.
-IncludeMoveReport SwitchParameter This parameter is reserved for internal Microsoft use.
-IncludeSoftDeletedRecipients SwitchParameter The IncludeSoftDeletedRecipients switch specifies whether to include soft deleted recipients in the results. You don't need to specify a value with this switch.
-PrimarySmtpAddress String The PrimarySmtpAddress identifies the mailbox that you want to view by primary SMTP email address (for example, navin@contoso.com).
-Properties String[] The Properties parameter specifies the properties that are returned in the output of this cmdlet. You can specify multiple values separated by commas.
-PropertySets PropertySet[] The PropertySets parameter specifies a logical grouping of properties that are returned in the output of this cmdlet. Valid values are:
-UserPrincipalName String The UserPrincipalName parameter identifies the mailbox that you want to view by UPN (for example, navin@contoso.onmicrosoft.com).

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