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.

Syntax

Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-GetChildren]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-Organization <OrganizationIdParameter>]
   [-ResidentFolders]
   [-ResultSize <Unlimited>]
   [-Server <ServerIdParameter>]
   [<CommonParameters>]
Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-Recurse]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-Organization <OrganizationIdParameter>]
   [-ResidentFolders]
   [-ResultSize <Unlimited>]
   [-Server <ServerIdParameter>]
   [<CommonParameters>]
Get-PublicFolder
   [-LostAndFound]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-Organization <OrganizationIdParameter>]
   [-ResidentFolders]
   [-ResultSize <Unlimited>]
   [<CommonParameters>]
Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-Organization <OrganizationIdParameter>]
   [-ResidentFolders]
   [-Server <ServerIdParameter>]
   [<CommonParameters>]

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.

Examples

Example 1

Get-PublicFolder

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

Example 2

Get-PublicFolder -Identity \NON_IPM_SUBTREE -Recurse | Format-List Name

This example returns the names of all the system folders (which aren't shown by default), starting at the system folder root (\NON_IPM_SUBTREE).

Example 3

Get-PublicFolder -Identity "\Legal\Documents\Pending Litigation"

This example returns the Pending Litigation public folder from \Legal\Documents\.

Example 4

Get-PublicFolder -Identity "\Legal\Documents\Pending Litigation" -Recurse

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.

Example 5

Get-PublicFolder -Identity "\Legal\Documents\Pending Litigation" -Recurse -ResultSize Unlimited

This example returns the Pending Litigation public folder from \Legal\Documents\ and all the public folders under the Pending Litigation public folder, without a limit on the number returned.

Example 6

Get-PublicFolder -Mailbox "Legal Department" -ResidentFolders

This example returns the public folders that reside in the public folder content mailbox Legal Department.

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
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019

-GetChildren

The GetChildren switch specifies whether to return only the children of the folder specified by the Identity parameter. You don't need to specify a value with this switch.

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

-Identity

The Identity parameter specifies the name and path of the public folder you want to view. A valid value uses the syntax: \Level1\Level2\...\LevenN\PublicFolder. For example, "\Customer Discussion" or "\Engineering\Customer Discussion".

Type:PublicFolderIdParameter
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

-LostAndFound

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
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2016, Exchange Server 2019, Exchange Online

-Mailbox

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
  • Alias
  • Distinguished name (DN)
  • Canonical DN
  • Domain\Username
  • Email address
  • GUID
  • LegacyExchangeDN
  • SamAccountName
  • User ID or user principal name (UPN)
Type:MailboxIdParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

-Organization

This parameter is available only in on-premises Exchange.

This parameter is reserved for internal Microsoft use.

Type:OrganizationIdParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2013, Exchange Server 2016, Exchange Server 2019

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

-ResidentFolders

The ResidentFolders switch specifies whether to return public folders that reside in a specific content public folder mailbox. You don't need to specify a value with this switch.

If you don't use this switch, the command will return only public folders whose contents reside in the primary hierarchy public folder mailbox.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, 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.

Type:Unlimited
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

-Server

This parameter is available only in Exchange Server 2010.

The Server parameter filters the results by the specified Exchange server. You can use any value that uniquely identifies the server. For example:

  • Name
  • FQDN
  • Distinguished name (DN)
  • Exchange Legacy DN
Type:ServerIdParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:Exchange Server 2010

Inputs

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.

Outputs

Output 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.