Get-EXOMailboxFolderStatistics

This cmdlet is available only in the Exchange Online PowerShell V2 module. For more information, see Use the Exchange Online PowerShell V2 module (https://docs.microsoft.com/powershell/exchange/exchange-online/exchange-online-powershell-v2/exchange-online-powershell-v2).

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.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://docs.microsoft.com/powershell/exchange/exchange-server/exchange-cmdlet-syntax).

Syntax

Get-EXOMailboxFolderStatistics
   [-Archive]
   [-ExternalDirectoryObjectId <Guid>]
   [-Folderscope <ElcFolderType>]
   [-Identity <String>]
   [-IncludeAnalysis]
   [-IncludeOldestAndNewestItems]
   [-IncludeSoftDeletedRecipients]
   [-ResultSize <Unlimited>]
   [-UserPrincipalName <String>]
   [<CommonParameters>]

Description

A mailbox can have hidden items that are never visible to the user and are only used by applications. The Get-EXOMailboxFolderStatistics cmdlet can return hidden items for the following values: FolderSize, FolderAndSubfolderSize, ItemsInFolder and ItemsInFolderAndSubfolders.

Don't confuse Get-EXOMailboxFolderStatistics cmdlet (folders) with the Get-EXOMailboxStatistics cmdlet (mailboxes).

Examples

Example 1

Get-EXOMailboxFolderStatistics -Identity admin@contoso.com

This example returns statistics for all mailbox folders. Default is FolderScope All.

Example 2

Get-EXOMailboxFolderStatistics -Identity admin@contoso.com -FolderScope Calendar -IncludeAnalysis -IncludeOldestAndNewestItems

This example returns statistics only for calendar folders.

Parameters

-Archive

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.

If you use this switch on a mailbox that doesn't have archiving enabled, an error is returned.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online
-ExternalDirectoryObjectId

The ExternalDirectoryObjectId parameter identifies the mailbox you want to view by using the ObjectId of the mailbox in Azure Active Directory. You can use this value instead of the Identity parameter.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
Applies to:Exchange Online
-Folderscope

The FolderScope parameter specifies the scope of the search by folder type. Valid values include:

  • All

  • Archive

  • Calendar

  • Clutter

  • Contacts

  • ConversationHistory

  • DeletedItems

  • Drafts

  • Inbox

  • Journal

  • JunkEmail

  • LegacyArchiveJournals

  • ManagedCustomFolder

  • NonIpmRoot

  • Notes

  • Outbox

  • Personal

  • RecoverableItems

  • RssSubscriptions

  • SentItems

  • SyncIssues

  • Tasks

Type:ElcFolderType
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online
-Identity

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:

  • GUID

  • User Principal Name (UPN)

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
Applies to:Exchange Online
-IncludeAnalysis

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.

You should use this switch for troubleshooting purposes, because the command might take a long time to complete.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online
-IncludeOldestAndNewestItems

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.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online
-IncludeSoftDeletedRecipients

The IncludeSoftDeletedRecipients switch specifies whether to include soft-deleted mailboxes in the results. You don't need to specify a value with this switch.

Soft-deleted mailboxes are mailboxes that have been deleted, but are still recoverable.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online
-UserPrincipalName

The UserPrincipalName parameter specifies the UPN for the mailbox you want to view (for example, navin.contoso.com).

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
Applies to:Exchange Online

Inputs

Outputs