Export (0) Print
Expand All

Get-MailboxFolder

Applies to: Exchange Server 2010

Topic Last Modified: 2011-03-19

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


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>]

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.

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.

Error Description

 

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

Get-MailboxFolder -Identity Tony:\Inbox

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

Get-MailboxFolder -Identity Tony 

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

Get-MailboxFolder -Identity Tony -GetChildren -MailFolderOnly

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

Get-MailboxFolder -Identity Tony:\Inbox -GetChildren

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

Get-MailboxFolder -Identity Tony:\Inbox -Recurse
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft