Commands › Exchange Online

Get-PublicFolder

Exchange Online ExchangeOnlineManagement Get-*

Retrieve the attributes of a public folder or a set of public folders.

Quick start script

# Get-PublicFolder — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-PublicFolder -GetChildren <SwitchParameter> -Recurse <SwitchParameter> -LostAndFound <SwitchParameter> | Format-List

# 3. Export for evidence / drift tracking
Get-PublicFolder | Export-Clixml .\PublicFolder-$(Get-Date -Format yyyyMMdd).xml

Syntax — 4 parameter sets

GetChildren

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

Recurse

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

LostAndFound

Get-PublicFolder [-LostAndFound]
 [-DomainController <Fqdn>]
 [-Mailbox <MailboxIdParameter>]
 [-Organization <OrganizationIdParameter>]
 [-ResidentFolders]
 [-ResultSize <Unlimited>]
 [<CommonParameters>]

Identity

Get-PublicFolder [[-Identity] <PublicFolderIdParameter>]
 [-DomainController <Fqdn>]
 [-Mailbox <MailboxIdParameter>]
 [-Organization <OrganizationIdParameter>]
 [-ResidentFolders]
 [-Server <ServerIdParameter>]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-Identity PublicFolderIdParameter 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...
-GetChildren SwitchParameter yes 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.
-Recurse SwitchParameter yes 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.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-LostAndFound SwitchParameter yes 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.
-Mailbox MailboxIdParameter The Mailbox parameter specifies the identity of the hierarchy public folder mailbox. You can use any value that uniquely identifies the mailbox. For example:
-Organization OrganizationIdParameter This parameter is available only in on-premises Exchange.
-ResidentFolders SwitchParameter 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.
-ResultSize Unlimited 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...
-Server ServerIdParameter The Server parameter filters the results by the specified Exchange server. You can use any value that uniquely identifies the server. For example:

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.