Commands › Exchange Online

Get-EXOMailboxFolderStatistics

Exchange Online ExchangeOnlineManagement Get-*

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

Quick start script

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

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

Syntax

Get-EXOMailboxFolderStatistics
 [-Archive]
 [-DiagnosticInfo <String>]
 [-ExternalDirectoryObjectId <Guid>]
 [-Folderscope <ElcFolderType>]
 [-Identity <String>]
 [-IncludeOldestAndNewestItems]
 [-IncludeSoftDeletedRecipients]
 [-PrimarySmtpAddress <String>]
 [-UserPrincipalName <String>]
 [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-Archive SwitchParameter The Archive switch specifies whether to return the usage statistics of the archive mailbox that's associated with the mailbox or mail user. You don't need to specify a value with this switch.
-DiagnosticInfo String **Note**: This parameter is deprecated in module version 3.7.0-Preview1 or later.
-ExternalDirectoryObjectId Guid The ExternalDirectoryObjectId parameter identifies the mailbox that you want to view by the ObjectId in Microsoft Entra ID.
-Folderscope ElcFolderType The FolderScope parameter specifies the scope of the search by folder type. Valid values include:
-Identity String The Identity parameter specifies the identity of the mailbox or mail user. For the best performance, we recommend using the user ID or user principal name (UPN) to identify the mailbox.
-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 The IncludeSoftDeletedRecipients switch specifies whether to include soft-deleted mailboxes 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).
-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.