Commands › Exchange Online

Get-MailboxFolderStatistics

Exchange Online ExchangeOnlineManagement Get-*

Retrieve information about the folders in a specified mailbox, including the number and size of items in the folder, the folder name and ID, and other information. **Note**: In Exchange Online PowerShell, we recommend that you use the Get-EXOMailboxFolderStatistics cmdlet instead of this cmdlet. For more information, see Connect to Exchange Online PowerShell.

Quick start script

# Get-MailboxFolderStatistics — 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-MailboxFolderStatistics -Identity <GeneralMailboxOrMailUserIdParameter> -Database <DatabaseIdParameter> -StoreMailboxIdentity <StoreMailboxIdParameter> | Format-List

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

Syntax — 3 parameter sets

Identity

Get-MailboxFolderStatistics [-Identity] <GeneralMailboxOrMailUserIdParameter>
 [-Archive]
 [-DiagnosticInfo <String>]
 [-DomainController <Fqdn>]
 [-FolderScope <ElcFolderType>]
 [-IncludeAnalysis]
 [-IncludeOldestAndNewestItems]
 [-IncludeSoftDeletedRecipients]
 [-ResultSize <Unlimited>]
 [-SkipCount <Int32>]
 [-UseCustomRouting]
 [<CommonParameters>]

AuditLog

Get-MailboxFolderStatistics [[-Identity] <GeneralMailboxOrMailUserIdParameter>]
 [-AuditLog]
 [-DiagnosticInfo <String>]
 [-DomainController <Fqdn>]
 [-FolderScope <ElcFolderType>]
 [-IncludeAnalysis]
 [-IncludeOldestAndNewestItems]
 [-IncludeSoftDeletedRecipients]
 [-ResultSize <Unlimited>]
 [-SkipCount <Int32>]
 [<CommonParameters>]

Database

Get-MailboxFolderStatistics -Database <DatabaseIdParameter> -StoreMailboxIdentity <StoreMailboxIdParameter>
 [-DiagnosticInfo <String>]
 [-FolderScope <ElcFolderType>]
 [-IncludeAnalysis]
 [-IncludeOldestAndNewestItems]
 [-IncludeSoftDeletedRecipients]
 [-ResultSize <Unlimited>]
 [-SkipCount <Int32>]
 [<CommonParameters>]

Parameters (14)

ParameterTypeRequiredWhat it controls
-Identity GeneralMailboxOrMailUserIdParameter yes The Identity parameter specifies the identity of the mailbox or mail user. You can use any value that uniquely identifies the mailbox or mail user. For example:
-Database DatabaseIdParameter yes This parameter is available only in the cloud-based service.
-StoreMailboxIdentity StoreMailboxIdParameter yes This parameter is available only in the cloud-based service.
-Archive SwitchParameter The Archive switch specifies whether to return the usage statistics of the archive associated with the mailbox or mail user. You don't need to specify a value with this switch.
-AuditLog SwitchParameter This parameter is available only in on-premises Exchange.
-DiagnosticInfo String This parameter is available only in the cloud-based service.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-FolderScope ElcFolderType The FolderScope parameter specifies the scope of the search by folder type. Valid parameter values include:
-IncludeAnalysis SwitchParameter The IncludeAnalysis switch specifies whether to scan all items within a folder and return statistics related to the folder and item size. You don't need to specify a value with this switch.
-IncludeOldestAndNewestItems SwitchParameter The IncludeOldestAndNewestItems switch specifies whether to return the dates of the oldest and newest items in each folder. You don't need to specify a value with this switch.
-IncludeSoftDeletedRecipients SwitchParameter This parameter is available only in the cloud-based service.
-ResultSize Unlimited This parameter is available only in the cloud-based service.
-SkipCount Int32 This parameter is available only in the cloud-based service.
-UseCustomRouting SwitchParameter This parameter is available only in the cloud-based service.

Message Center changes mentioning this command

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