The Get-MailboxFolderStatistics PowerShell cmdlet is used to get detailed statistic info about folders and subfolders in mailboxes on on-premises Exchange Server and in Exchange Online (Microsoft 365). This cmdlet displays information about the folders in the mailbox (including the system folders), their sizes, number of items, hierarchy, creation time, modification time, and last accessed time.
Permissions
To retrieve folder statistics, your account must have permission to access the target mailbox. In Exchange Online, this typically requires organization-level admin roles (such as Exchange Administrator) or explicit mailbox permissions. Without sufficient permissions, the cmdlet may return access-related errors.
Get-MailboxFolderStatistics examples
Open the EMS console (if you’re using on-prem Exchange) or use the Connect-ExchangeOnline command to connect to your Microsoft 365 tenant.
For Exchange Online, we recommend using Get-EXOMailboxFolderStatistics, which is available in the Exchange Online PowerShell module. Get-MailboxFolderStatistics is also available in Exchange Online and is used with Exchange Server. The examples below use Get-MailboxFolderStatistics to cover both environments.
When the cmdlet is run with the user’s UPN as an attribute, it returns a list of the folders in the mailbox:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com | ft

List the folders in the user’s mailbox, sizes, and the number of items
Note. The examples that use ToBytes() assume that the returned size property exposes this method. In classic remote PowerShell sessions, Exchange objects may be deserialized and the method may not be available. If ToBytes() fails, you need to inspect the returned property with Get-Member and use the available numeric property/conversion method.
Let’s list the folders in the user’s mailbox, their sizes, and the number of items. In addition, we will sort the folders in the mailbox according to their size:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com -FolderScope All |
Sort-Object {$_.FolderSize.ToBytes()} -Descending |
Format-Table -AutoSize `
Name,
FolderType,
FolderSize,
ItemsInFolder
Also, keep in mind that FolderSize is non-recursive. In case you need to sort by total mailbox impact, you should use FolderAndSubfolderSize instead.

View information about a specific folder (for example, Inbox) including when it was last modified:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com -FolderScope Inbox | Select Name, FolderType, FolderSize, ItemsInFolder, FolderAndSubfolderSize, ItemsInFolderAndSubfolders, LastModifiedTime
Understanding FolderScope Behavior
Keep in mind that the -FolderScope parameter does not filter arbitrary mailbox folder paths. This method works only with predefined mailbox folder scopes such as:
- Inbox
- Calendar
- Contacts
- SentItems
- DeletedItems
- RecoverableItems
- NonIPMRoot
- Archive
- All
Here is an example:
Get-MailboxFolderStatistics -Identity user@domain.com -FolderScope Inbox
The method mentioned above does not recursively return all custom subfolders located under Inbox. Instead, it limits the query to the predefined Inbox folder scope recognized by Exchange.
Note that some FolderScope values are environment-dependent (and may not be available in all Exchange versions).
In case you need to locate a specific custom subfolder, you should filter by FolderPath instead of relying on FolderScope:
Get-MailboxFolderStatistics cyril@theitbros.com |
Where-Object {
$_.FolderPath -match 'Projects'
}
Note that one major advantage of using FolderScope is that it works independently of mailbox localization. For example, the Inbox folder may appear as “Inbox”, “ะั ะพะดััะธะต”, or “Boรฎte de rรฉception” depending on the mailbox language settings, but the Inbox scope remains consistent.
Converting folder sizes to Mb or Gb
FolderSize and FolderAndSubfolderSize are returned as ByteQuantifiedSize values. The exact properties and methods available for size conversion can depend on how the Exchange cmdlet output is returned.ย Before using conversion methods such as ToMB() or ToGB(), you can inspect the returned object’s available properties and methods with Get-Member command:
Get-MailboxFolderStatistics cyril@theitbros.com |
Select-Object -First 1 -ExpandProperty FolderSize |
Get-Member
For a basic folder-size report, you can use the FolderSize property directly:
Get-MailboxFolderStatistics cyril@theitbros.com |
Select-Object Name, FolderPath, FolderSize, ItemsInFolder
In case your Exchange environment returns a ByteQuantifiedSize object with conversion methods, you can use the available methods to convert the value to MB/GB. However, avoid assuming that methods such as .ToMB() or .ToGB() are available in every Exchange PowerShell session, especially when working with deserialized objects from classic remote PowerShell sessions.
Understanding Folder vs Subfolder Metrics
Note that the Get-MailboxFolderStatistics cmdlet returns 2 different types of metrics. It depends on whether the value includes only the current folder or the entire folder hierarchy.
| Property | Meaning |
|---|---|
| FolderSize | Size of the current folder only (non-recursive) |
| ItemsInFolder | Number of items in the current folder only |
| FolderAndSubfolderSize | Total size including all subfolders (recursive) |
| ItemsInFolderAndSubfolders | Total items including all subfolders (recursive) |
Keep in mind that FolderSize and ItemsInFolder do not include subfolders.
For recursive analysis (mailbox quota troubleshooting or storage investigation), you should always use the *AndSubfolders* properties.
Get Folder Statistics for All Mailboxes
Get-MailboxFolderStatistics is often used in enterprise environments. It allows generating mailbox folder reports for multiple users at once. For example, you can query all mailboxes in Exchange Online/Exchange Server and retrieve folder sizes, item counts, and mailbox names:
Get-Mailbox -ResultSize Unlimited | ForEach-Object {
try {
Get-MailboxFolderStatistics -Identity $_.UserPrincipalName |
Select-Object @{
Name='Mailbox'
Expression={$_.UserPrincipalName}
},
Name,
FolderPath,
FolderSize,
ItemsInFolder
}
catch {
Write-Warning "Failed to retrieve folder statistics for $($_.UserPrincipalName): $($_.Exception.Message)"
}
} You can also export the report to a CSV file for further analysis:
Get-Mailbox -ResultSize Unlimited | ForEach-Object {
try {
Get-MailboxFolderStatistics -Identity $_.UserPrincipalName |
Select-Object @{
Name='Mailbox'
Expression={$_.UserPrincipalName}
},
Name,
FolderPath,
FolderSize,
ItemsInFolder
}
catch {
Write-Warning "Failed to retrieve folder statistics for $($_.UserPrincipalName): $($_.Exception.Message)"
}
} | Export-Csv "C:\Reports\MailboxFolderReport.csv" -NoTypeInformation Note that many organizations actively use Exchange Online Archive mailboxes for long-term storage and compliance. Keep in mind that Get-MailboxFolderStatistics does not include archive mailbox folders (unless you explicitly use the -Archive switch).
Here is an example:
Get-Mailbox -ResultSize Unlimited | ForEach-Object {
Get-MailboxFolderStatistics `
-Identity $_.UserPrincipalName `
-Archive |
Select-Object @{
Name='Mailbox'
Expression={$_.Identity}
},
Name,
FolderPath,
FolderAndSubfolderSize,
ItemsInFolderAndSubfolders
} Note. In large Exchange Online environments, bulk mailbox reporting may trigger throttling. We recommend processing mailboxes in batches and using the modern Get-EXOMailboxFolderStatistics cmdlet whenever possible.
Export Mailbox Folder Statistics to CSV
You can export mailbox folder statistics to a CSV file for reporting, auditing, or storage analysis purposes:
Get-MailboxFolderStatistics cyril@theitbros.com |
Select-Object `
Name,
FolderPath,
FolderSize,
ItemsInFolder,
LastModifiedTime |
Export-Csv `
-Path "C:\Reports\MailboxFolders.csv" `
-NoTypeInformation
The command above exports the mailbox folder statistics into a CSV report, you can open it in Microsoft Excel/import into reporting tools.
Find Largest Mailbox Folders
One of the most common admin scenarios for the Get-MailboxFolderStatistics cmdlet is mailbox quota troubleshooting.
You can use the cmdlet to identify the largest folders in a mailbox and determine which folders consume the most storage space:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com `
| Sort-Object {$_.FolderAndSubfolderSize.ToBytes()} -Descending `
| Select-Object -First 10 Name, FolderAndSubfolderSize, ItemsInFolderAndSubfolders
The method mentioned above uses FolderAndSubfolderSize because it provides a true representation of storage consumption (including all nested subfolders).
Show Only User-Created Mailbox Folders
If you want to exclude Exchange system folders from the report, you can filter the output to display only user-created folders:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com |
Where-Object {$_.FolderType -eq "User Created"} |
Select-Object Name, FolderPath, FolderSize, ItemsInFolder
The example shown above displays only folders created by the mailbox user, making reports easier to read and helping administrators focus on user data instead of Exchange system folders.
Note. The FolderType property depends on the folder type recognized by Exchange. Most user-created folders are reported as User Created, while built-in folders (Inbox, Sent Items, Recoverable Items, Calendar, etc.) use predefined folder types.
Get the name of folders
You can use this cmdlet to find out the exact names of the predefined mailbox folders (such as Calendar, Inbox, Sent Items, Tasks, and others) because their display names might differ depending on the mailbox’s language settings. Get the name of the Calendar folder:
(Get-MailboxFolderStatistics cyril@theitbros.com -FolderScope Calendar).Identity

Script to visualize the folder hierarchy of a user’s mailbox
Use the following script to visualize the folder hierarchy (tree structure) of a user’s mailbox:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com | Sort-Object FolderPath | ForEach-Object {
$depth = ($_.'FolderPath' -split "/").Count - 1
(" " * ($depth * 4)) + $_.FolderPath
} 
Get information about hidden mailbox folders
The Get-MailboxFolderStatistics cmdlet can be used to get information about hidden mailbox folders that are not accessible from the Outlook or OWA client interface. For example, about item statistics in the RecoverableItems (Dumpster) or Archive mailbox.
Get-MailboxFolderStatistics cyril@theitbros.com -FolderScope RecoverableItems | Select Name, FolderType, FolderSize, ItemsInFolder, FolderAndSubfolderSize, ItemsInFolderAndSubfolders
or:
Get-MailboxFolderStatistics cyril@theitbros.com -Archive
Note that RecoverableItems folders may consume significant mailbox storage. This can lead to mailbox quota problems even when visible mailbox folders appear small.
Analyzing Recoverable Items Storage Usage
When troubleshooting mailbox quota issues, it’s often useful to determine which Recoverable Items subfolders consume the most storage space. The following command lists the largest folders in the Recoverable Items subtree:
Get-MailboxFolderStatistics -Identity cyril@theitbros.com `
-FolderScope RecoverableItems |
Sort-Object {$_.FolderAndSubfolderSize.ToBytes()} -Descending |
Select-Object Name, FolderAndSubfolderSize
This report helps you to identify whether folders such as Deletions, Purges, DiscoveryHolds, or Versions are responsible for excessive mailbox storage usage. These folders often grow because of retention policies, litigation hold, or deleted item retention settings.
Get Non-IPM (Non-Interpersonal Messaging) subtree folders
You can view information about Non-IPM (Non-Interpersonal Messaging) subtree folders, which include service mailbox folders that are used by other Microsoft services. For example, Teams private chat messages and so on:
Get-MailboxFolderStatistics cyril@theitbros.com -FolderScope NonIPMRoot | Select Name, FolderType, FolderSize, ItemsInFolder, FolderAndSubfolderSize, ItemsInFolderAndSubfolders
Hint. In Exchange Online, it is recommended to use the Get-EXOMailboxFolderStatistics command instead of the Get-MailboxFolderStatistics command to get mailbox folder info.
Performance Considerations in Exchange Online
- Note that Get-MailboxFolderStatistics command can be slow for large mailboxes. You should avoid running it against thousands of mailboxes simultaneously.
- Keep in mind also that EXO throttling may apply and you should prefer Get-EXOMailboxFolderStatistics in EXO.
- One more important thing to consider is to use batching/throttling delays.
You can add delay between mailbox queries to avoid throttling with the command:
Start-Sleep -Milliseconds 300
What does Get-MailboxFolderStatistics do in Exchange?
The Get-MailboxFolderStatistics PowerShell cmdlet displays detailed information about mailbox folders in Exchange Server and Exchange Online. It can show:
- folder sizes;
- item counts;
- folder hierarchy;
- last modified time;
- hidden system folders;
- archive mailbox folders.
Administrators commonly use it for mailbox quota troubleshooting, reporting, and storage analysis.
What does the -FolderScope parameter do?
-FolderScope limits results to predefined Exchange mailbox scopes such as:
- Inbox
- Calendar
- Contacts
- SentItems
- DeletedItems
- RecoverableItems
- Archive
Why use Get-EXOMailboxFolderStatistics instead of Get-MailboxFolderStatistics?
In Exchange Online, Get-EXOMailboxFolderStatistics is generally preferred because it:
- performs better;
- handles large environments more efficiently;
- works better with Exchange Online throttling.
This is especially important in Microsoft 365 enterprise environments.
Why is Get-MailboxFolderStatistics slow in Exchange Online?
Large mailboxes and bulk reporting operations may trigger Exchange Online throttling.
To reduce throttling risks:
- process mailboxes in batches;
- add delays between queries;
- prefer Get-EXOMailboxFolderStatistics.
Can Get-MailboxFolderStatistics display hidden folders?
Yes. The cmdlet can display hidden mailbox folders such as:
- RecoverableItems;
- NonIPMRoot;
- Archive folders.
These folders are usually inaccessible from Outlook or OWA but may consume significant storage space.
