In this article

Get-PublicFolder

This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.
Use the Get-PublicFolder cmdlet to retrieve the attributes of a public folder or a set of public folders.
For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://technet.microsoft.com/library/bb123552.aspx).

Description

You need to be assigned permissions before you can run this cmdlet. Although this topic lists all parameters for the cmdlet, you may not have access to some parameters if they're not included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet (https://technet.microsoft.com/library/mt432940.aspx).

Examples

-------------------------- Example 1 --------------------------

Get-PublicFolder

This example uses the Get-PublicFolder command without parameters to return the root public folder object (IPM_SUBTREE).

This example returns the Pending Litigation public folder from \Legal\Documents\ and all the public folders under the Pending Litigation public folder. Because the result size isn't specified, the command returns up to the maximum number of public folders, which is 10,000.

The LostAndFound switch specifies whether to return only orphaned folders that are located in \NON_IPM_SUBTREE\LOST_AND_FOUND. You don't need to specify a value with this switch.

The LOST_AND_FOUND folder holds missing folders that are recreated by the public folder hierarchy reconciliation process when the folder exists in a secondary public folder mailbox, but not in the primary.

You can't use this switch with the Identity parameter or the Recurse or LostAndFound switches.

Type:

SwitchParameter

Position:

Named

Default value:

None

Accept pipeline input:

False

Accept wildcard characters:

False

Applies to:

Exchange Server 2016, Exchange Online

-Recurse

The Recurse switch specifies whether to return the specified public folder and all its children. You don't need to specify a value with this switch.

You can't use this switch with the GetChildren or LostAndFound switches.

Optional Parameters

-DomainController

This parameter is available only in on-premises Exchange.

The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name (FQDN). For example, dc01.contoso.com.

Type:

Fqdn

Position:

Named

Default value:

None

Accept pipeline input:

False

Accept wildcard characters:

False

Applies to:

Exchange Server 2010, Exchange Server 2013, Exchange Server 2016

-Identity

The Identity parameter specifies the GUID or public folder name that represents a specific public folder. You can also include the path using the format \TopLevelPublicFolder\PublicFolder.

You can omit the parameter label Identity so that only the public folder name or GUID is supplied.

The Mailbox parameter specifies the identity of the hierarchy public folder mailbox. You can use any value that uniquely identifies the mailbox.

For example:

Name

Display name

Alias

Distinguished name (DN)

Canonical DN

<domain name>\<account name>

Email address

GUID

LegacyExchangeDN

SamAccountName

User ID or user principal name (UPN)

Type:

MailboxIdParameter

Position:

Named

Default value:

None

Accept pipeline input:

False

Accept wildcard characters:

False

Applies to:

Exchange Server 2013, Exchange Server 2016, Exchange Online

-ResidentFolders

The ResidentFolders specifies whether to return public folders that reside in a specific content public folder mailbox. If this parameter isn't specified, the command will only return public folders whose contents reside in the primary hierarchy public folder mailbox.

Type:

SwitchParameter

Position:

Named

Default value:

None

Accept pipeline input:

False

Accept wildcard characters:

False

Applies to:

Exchange Server 2013, Exchange Server 2016, Exchange Online

-ResultSize

The ResultSize parameter specifies the maximum number of results to return. The default maximum is 10,000. For no limit on the returned results, set this parameter to Unlimited. This parameter can only be passed in combination with the Recurse or GetChildren parameters.

Outputs

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types (https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Output Type field is blank, the cmdlet doesn't return data.