Get-MailboxFolder
SYNOPSIS
Retrieve mailbox folder statistics for a specified mailbox.
SYNTAX
Get-MailboxFolder [-Identity] <String> [[-Folder] <String>] [[-FolderScope] <String>]
[-SearchMailboxAndUsersWithPermissions] [[-Properties] <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The `Get-MailboxFolder` function retrieves mailbox folder statistics for a specified mailbox. It supports filtering by folder name, folder scope, and additional properties. The function can also search for mailboxes with permissions to the specified mailbox.
EXAMPLES
EXAMPLE 1
Get-MailboxFolder -Identity "[email protected]"
Retrieves folder statistics for all folders in the mailbox `user@example.com`.
EXAMPLE 2
Get-MailboxFolder -Identity "[email protected]" -Folder "Inbox"
Retrieves folder statistics for the `Inbox` folder in the mailbox `user@example.com`.
EXAMPLE 3
Get-MailboxFolder -Identity "[email protected]" -FolderScope "SentItems"
Retrieves folder statistics for the `SentItems` folder in the mailbox `user@example.com`.
EXAMPLE 4
Get-MailboxFolder -Identity "[email protected]" -SearchMailboxAndUsersWithPermissions
Retrieves folder statistics for the mailbox `user@example.com` and mailboxes with permissions to it.
PARAMETERS
-Identity
The identity of the mailbox (e.g., UserPrincipalName, DistinguishedName, or SamAccountName) to retrieve folder statistics for.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-Folder
The name of the folder to retrieve statistics for. Defaults to '*'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: *
Accept pipeline input: False
Accept wildcard characters: False
-FolderScope
The scope of the folder to retrieve. Valid values include `All`, `Inbox`, `SentItems`, etc. Defaults to `All`.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
-SearchMailboxAndUsersWithPermissions
A switch to include mailboxes with permissions to the specified mailbox in the search.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Properties
An array of properties to include in the output. Defaults to `Identity`, `Date`, `ItemsInFolder`, and `FolderSize`.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: @('Identity', 'Date', 'ItemsInFolder', 'FolderSize')
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.