Commands › Exchange Online

Set-PublicFolder

Exchange Online ExchangeOnlineManagement Set-*

Set the attributes of public folders.

Quick start script

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

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-PublicFolder
$before | Format-List

# 3. Make the change (dry run first)
Set-PublicFolder -Identity <PublicFolderIdParameter> -WhatIf
Set-PublicFolder -Identity <PublicFolderIdParameter>

# 4. Verify and diff
$after = Get-PublicFolder
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-PublicFolder [-Identity] <PublicFolderIdParameter>
 [-AgeLimit <EnhancedTimeSpan>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-EformsLocaleId <CultureInfo>]
 [-Force]
 [-HiddenFromAddressListsEnabled <Boolean>]
 [-IssueWarningQuota <Unlimited>]
 [-LocalReplicaAgeLimit <EnhancedTimeSpan>]
 [-MailRecipientGuid <Guid>]
 [-MailEnabled <Boolean>]
 [-MaxItemSize <Unlimited>]
 [-Name <String>]
 [-OverrideContentMailbox <MailboxIdParameter>]
 [-Path <PublicFolderIdParameter>]
 [-PerUserReadStateEnabled <Boolean>]
 [-ProhibitPostQuota <Unlimited>]
 [-Replicas <DatabaseIdParameter[]>]
 [-ReplicationSchedule <Schedule>]
 [-RetainDeletedItemsFor <EnhancedTimeSpan>]
 [-Server <ServerIdParameter>]
 [-UseDatabaseAgeDefaults <Boolean>]
 [-UseDatabaseQuotaDefaults <Boolean>]
 [-UseDatabaseReplicationSchedule <Boolean>]
 [-UseDatabaseRetentionDefaults <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (26)

ParameterTypeRequiredWhat it controls
-Identity PublicFolderIdParameter yes The Identity parameter specifies the name and path of the public folder you want to modify. A valid value uses the format: `\Level1\Level2\...\LevenN\PublicFolder`. For example, `"\Customer Discussion"` or...
-AgeLimit EnhancedTimeSpan The AgeLimit parameter specifies the overall age limit on the folder. Items that reach the age limit are deleted from the public folder. Replicas of this public folder are automatically deleted when the age limit is exceeded.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-EformsLocaleId CultureInfo The EformsLocaleId parameter specifies the locale-specific version of the e-forms library. The valid input for the EformsLocaleId parameter is the string names listed in the Culture Name column in the Microsoft .NET...
-Force SwitchParameter The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.
-HiddenFromAddressListsEnabled Boolean The HiddenFromAddressListsEnabled parameter specifies whether to hide the public folder from address lists.
-IssueWarningQuota Unlimited The IssueWarningQuota parameter specifies the public folder size that triggers a warning to public folder owners stating that the folder is almost full.
-LocalReplicaAgeLimit EnhancedTimeSpan This parameter is available only in Exchange Server 2010
-MailEnabled Boolean The MailEnabled parameter specifies that the public folder is mail-enabled. To do this, you use the value $true.
-MailRecipientGuid Guid The MailRecipientGuid parameter specifies the MailRecipientGuid value of the public folder. You use this parameter to correct a mail-enabled public folder that lost its MailRecipientGuid value.
-MaxItemSize Unlimited The MaxItemSize parameter specifies the maximum size for posted items. Items larger than the value of the MaxItemSize parameter are rejected. The default value is unlimited, which is 2 gigabytes. When you enter a...
-Name String The Name parameter specifies the name for the public folder.
-OverrideContentMailbox MailboxIdParameter This parameter is available only in on-premises Exchange.
-Path PublicFolderIdParameter The Path parameter specifies the path of the public folder, for example, \\TopLevelPublicFolder\\PublicFolder.
-PerUserReadStateEnabled Boolean The PerUserReadStateEnabled parameter specifies whether to maintain read and unread data on a per-user basis.
-ProhibitPostQuota Unlimited The ProhibitPostQuota parameter specifies the size of a public folder at which users are notified that the public folder is full. Users can't post to a folder whose size is larger than the ProhibitPostQuota parameter...
-Replicas DatabaseIdParameter[] This parameter is available only in Exchange Server 2010
-ReplicationSchedule Schedule This parameter is available only in Exchange Server 2010
-RetainDeletedItemsFor EnhancedTimeSpan The RetainDeletedItemsFor parameter specifies the retention time for deleted items.
-Server ServerIdParameter This parameter is available only in Exchange Server 2010
-UseDatabaseAgeDefaults Boolean This parameter is available only in Exchange Server 2010
-UseDatabaseQuotaDefaults Boolean This parameter is available only in Exchange Server 2010
-UseDatabaseReplicationSchedule Boolean This parameter is available only in Exchange Server 2010
-UseDatabaseRetentionDefaults Boolean This parameter is available only in Exchange Server 2010
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

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