Administrators managing public folders in Exchange Online may encounter scenarios where data loss occurs due to various reasons. For example, a user might delete an email from a public folder and later need to restore it after the retention period has expired, or purged data may be required for compliance or legal purposes. To mitigate such risks, Exchange Online provides retention policies for public folders. These policies allow you to retain deleted data for a specified duration or indefinitely, or to delete content automatically after it reaches a certain age.
The following sections will guide you through:
- How to configure retention policies on public folders
- How retention for public folders works
- How to restore purged data
- Known issues and troubleshooting steps
Configuring retention policy on a public folder
To ensure deleted data is retained in the public folder Recoverable Items folder (sometimes called “dumpster”) for a specified period, follow these steps to create a new retention policy for your tenant's public folders:
- Sign in to the Microsoft Purview portal > Solutions > Data Lifecycle Management > Policies > Retention policies.
- Ensure that Exchange public folder mailboxes contain at least 10 MB of data before proceeding. Use the Get-MailboxStatistics command to verify data size across public folder mailboxes.
- Select New retention policy to begin the Create retention policy configuration and assign a name to your new policy.
- On the Assign admin units page, keep the default setting of Full directory. Currently, admin units are not supported for this policy.
- Exchange public folders do not support adaptive scopes; you must use a static scope. Exclusions are not supported for these locations.
- On the Decide if you want to retain content, delete it, or both page, specify your preferences for retaining and deleting content.
You can configure a retention policy to retain content only, retain and then delete content after a specified period, or delete content after a specified period. The duration of the retention policy can be based on:
- Item creation date (e.g., CreationTime)
- Item last modification date (e.g., LastModificationTime)
For more details, refer to Settings for retaining and deleting content.
- Complete the configuration and save your settings.
Policy updates are typically applied quickly but may take several days to propagate. Once replication is complete, the retention policy status in the Microsoft Purview portal or compliance portal will change from Enabled (Pending) to Enabled (Success). If the status remains pending, contact Microsoft support for assistance.
Note: Exchange public folder messages do not support retention labels
How retention for public folders works
When public folders are placed on hold using a retention policy:
- The InPlaceholds parameter on the root or primary public folder mailbox will contain the policy identity. For details, refer to this article.
- DiscoveryHolds folders are created under Non_IPM_Subtree for each content public folder mailbox. Their functions include:
- Preserving purged items within the DiscoveryHolds folder on the same content mailbox.
- The PublicFolderDiscoveryHoldsProcessor runs daily to process DiscoveryHolds folders and subfolders on each content public folder mailbox, expiring items and folders that do not meet the in-place hold duration.
Consider the following scenario: A tenant public folder under retention hold, such as "\pf4," contains an email with the subject "Test Mail" in the content mailbox "2ndMBX." You can validate the presence of the email using the Get-PublicFolderItemStatistics command before deletion.
When the email "Test Mail" is deleted, it is moved to the folder's dumpster (e.g., "\pf4" dumpster), where it is retained for one day before being purged.
After the retention period expires, the item is moved to the DiscoveryHolds folder within the content mailbox of the owning folder (e.g., "\pf4").
After the retention period, the item is moved to the DiscoveryHolds folder within the content mailbox of the owning folder (e.g., "\pf4").
Consider another scenario: Deleting a public folder with data inside. For example, a child public folder "\pf5\pf6" contains an email with the subject "Test Mail." You can validate the presence of the email using the Get-PublicFolderItemStatistics command before deletion.
When the folder "\pf5\pf6" is deleted, the folder and its contents are moved to the parent folder's dumpster (e.g., "\pf5" dumpster).
After the parent folder's retention deletion period expires, the folder "\pf6" is moved to the DiscoveryHolds folder with a new name (FolderName_GUID) in the content mailbox of the parent folder (e.g., "\pf5"), along with the email "Test Mail" inside.
Purged folders and items are retained for the duration specified by the applied retention policy.
As an administrator, monitor each content mailbox's TotalDeletedItemSize and TotalItemSize parameters to prevent deletion, hold, and creation issues for resident public folders. Issues may occur if:
After the parent folder retention deletion period passed we can validate the folder “\pf6” has been moved under DiscoveryHolds folder with new naming as follows FolderName_GUID under the content mailbox of the parent folder e.g. “\pf5” with the email with subject “Test Mail” inside.
The purged folder/items shall retain for the duration that the applied retention policy implies.
As an admin you should monitor each content mailbox TotalDeletedItemSize & TotalItemSize parameters to prevent deletion, hold & creation issues for resident public folders over that content mailbox which shall occur if the content public folder mailbox,
- TotalDeletedItemSize exceeds RecoverableItemsQuota
- The sum of TotalItemSize and TotalDeletedItemSize exceeds ProhibitSendReceiveQuota
Refer to this article for guidance on checking these values and maintaining healthy quotas.
Note: You can use the following script to address quota issues if they are detected: Scripts/Public Folders/CheckEXOMePf/CheckEXOMePf.md at main · hazemembaby/Scripts
How to restore purged public folder items under retention hold
Next, we will discuss how to restore purged items that are under retention hold.
Content search is the key tool for locating and restoring purged items. The following example provides further clarification.
For instance, to locate purged email items with the subject "Test Mail" in public folders:
An administrator can create a new content search named "Look for mails on PF" to search for these items in the "Exchange public folders" location, using the condition: email subject "Test Mail."
As shown in the screenshots below from Purview content search results and the results.csv file, two items were found under DiscoveryHolds in the content public folder mailboxes 2ndmbx and 3rdmbx.
You can verify the location of these items using the Original Path or Location Name fields.
If results are downloaded, you would see something similar to:
Original Path: 2ndMBX_fcb8821f@(domain).onmicrosoft.com, Primary, 68fc5185-4bd5-4777-9d3d-f85fd216def5\2ndMBX_fcb8821f@(domain).onmicrosoft.com (Primary)\NON_IPM_SUBTREE\DiscoveryHolds
Location Name: 2ndMBX_fcb8821f@(domain).onmicrosoft.com
To restore these items:
- Export the located items to a PST file using Purview content search.
- Add or open the PST file in Outlook with the necessary permissions for the target public folder.
- Copy the items back to the required public folder using Outlook.
Alternatively, purged folders can be restored using PowerShell. Restoring the public folder will also restore all subfolders and items contained within it.
Known issues and troubleshooting
Finally, the following section outlines known issues and troubleshooting tips.
- In rare cases, the DiscoveryHolds folder may not sync to the current mailbox from the primary public folder mailbox. To resolve this, manually trigger a sync using the following command:
Update-publicFolderMailbox "affected mailbox" -InvokeSynchronizer -ForceOnlineSync -FullSync
If DiscoveryHolds is out of sync on a mailbox (e.g., 2ndmbx), items under the dumpster folders will not be processed. Forcing a sync on the mailbox will synchronize the DiscoveryHolds folder, allowing items in the dumpster to be processed as expected.
Forcing a sync on 2ndmbx synced DiscoveryHolds folder so items in Dumpster shall be processed regularly
- Purged folders that were previously added as user favorites in Outlook on the Web (OWA) may still appear with their new retained name ("Name_GUID") until the retention period expires. As a workaround, instruct users to remove these folders from their favorites in Outlook on the Web.
I hope this content has been informative and helpful to you.
Special thanks to Bhalchandra Atre for reviewing and contributing to this post.
Hazem Embaby
Senior Support Escalation Engineer