Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

Topic Last Modified: 2012-11-16

Use the Get-MailboxFolder cmdlet to retrieve folders for a specified mailbox when the mailbox owner runs the command.

Syntax

Get-MailboxFolder [-Identity <MailboxFolderIdParameter>] [-DomainController <Fqdn>]
Get-MailboxFolder [-Identity <MailboxFolderIdParameter>] -Recurse <SwitchParameter> [-DomainController <Fqdn>] [-MailFolderOnly <SwitchParameter>] [-ResultSize <Unlimited>]
Get-MailboxFolder [-Identity <MailboxFolderIdParameter>] -GetChildren <SwitchParameter> [-DomainController <Fqdn>] [-MailFolderOnly <SwitchParameter>] [-ResultSize <Unlimited>]

Detailed Description

If the mailbox isn't specified, the cmdlet returns the specified folders in the mailbox of the mailbox owner currently running the command. This command checks that the mailbox specified in the Identity parameter is a valid Exchange mailbox before retrieving the requested folders. The cmdlet returns all folders if the MailFolderOnly parameter isn't specified.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "User options" entry in the Client Access Permissions topic.

Parameters

Parameter Required Type Description

GetChildren

Required

System.Management.Automation.SwitchParameter

The GetChildren parameter specifies whether to return only the first level of subfolders under the specified parent folder. You can't specify both this parameter and the Recurse parameter at the same time. The default value is $false.

Recurse

Required

System.Management.Automation.SwitchParameter

The Recurse parameter specifies whether to return the specified parent folder and all of its subfolders. You can't specify both this parameter and the GetChildren parameter at the same time. The default value is $false.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxFolderIdParameter

The Identity parameter specifies the mailbox and the folder that the command returns information about. If the folder isn't specified, the command returns information about folders in the root hierarchy of the specified mailbox. You can specify values in the following format: <Mailbox Identity>:<Parent>

Valid values for <Mailbox Identity> include:

  • GUID

  • ADObjectID distinguished name

  • Domain\username

  • User principal name (UPN)

  • LegacyExchangeDN

  • SMTP address

  • Alias

  • Store object ID of the parent folder

Values for <Parent> can be both the store object ID and a path string such as \Inbox\Personal.

MailFolderOnly

Optional

System.Management.Automation.SwitchParameter

The MailFolderOnly parameter specifies whether to return only the mail folders in the specified mailbox. The default value is $false.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of settings to return. If you want to return all settings that match the command, use unlimited for the value of this parameter.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.

Examples

EXAMPLE 1

This example retrieves the Inbox folder in Tony's mailbox. The Identity parameter is supplied in the format of <Mailbox Identity>:<Folder>.

Copy Code
Get-MailboxFolder -Identity Tony:\Inbox

EXAMPLE 2

This example returns the root folders in Tony's mailbox. The Identity parameter is supplied in the format of <Mailbox Identity>.

Copy Code
Get-MailboxFolder -Identity Tony 

EXAMPLE 3

This example returns the first level of mail folders in Tony's mailbox.

Copy Code
Get-MailboxFolder -Identity Tony -GetChildren -MailFolderOnly

EXAMPLE 4

This example returns information about all the subfolders under Inbox in Tony's mailbox.

Copy Code
Get-MailboxFolder -Identity Tony:\Inbox -GetChildren

EXAMPLE 5

This example returns all levels of folders under Inbox in Tony's mailbox.

Copy Code
Get-MailboxFolder -Identity Tony:\Inbox -Recurse