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

Syntax

Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-GetChildren]
   [-DomainController <Fqdn>]
   [-ResultSize <Unlimited>]
   [-Server <ServerIdParameter>]
   [-Mailbox <MailboxIdParameter>]
   [-ResidentFolders]
   [-Recurse]
   [<CommonParameters>]
Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-Recurse]
   [-DomainController <Fqdn>]
   [-ResultSize <Unlimited>]
   [-Server <ServerIdParameter>]
   [-Mailbox <MailboxIdParameter>]
   [-ResidentFolders]
   [-GetChildren]
   [<CommonParameters>]
Get-PublicFolder
   [-LostAndFound]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-ResidentFolders]
   [-ResultSize <Unlimited>]
   [<CommonParameters>]
Get-PublicFolder
   [[-Identity] <PublicFolderIdParameter>]
   [-DomainController <Fqdn>]
   [-Mailbox <MailboxIdParameter>]
   [-ResidentFolders]
   [<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 (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).

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

Required Parameters

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

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

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.

Type:PublicFolderIdParameter
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, 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

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

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

The Server parameter specifies the server on which to perform the selected operations.

Type:ServerIdParameter
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:Exchange Server 2010

Inputs

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types (https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.

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.