How to Restore a Soft-Deleted Exchange Online Public Folder Mailbox
Question details
The user needs to recover a soft-deleted public folder mailbox in Exchange Online that fails to restore via standard PowerShell cmdlets.

- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- Attempting to reverse an accidental deletion of a public folder mailbox using the Undo-SoftDeletedMailbox command in PowerShell.
- Observed behavior
- The deleted public folder mailbox appears in PowerShell as soft-deleted, but the restoration command fails due to retention limits, insufficient permissions, or unsupported cmdlet syntax.
Verify that your Microsoft 365 account holds Global Administrator or Exchange Administrator privileges, and ensure the mailbox was deleted within the default 30-day retention period.
Verify Mailbox Retention Limits and Exchange Permissions
Confirm that the soft-deleted mailbox is still within the recoverable window and that your admin account is properly configured.
When a public folder mailbox is soft-deleted, it remains in the Azure Active Directory recycle bin for 30 days. If this retention period has elapsed, the mailbox is permanently purged and cannot be recovered using standard Exchange cmdlets.
Sign in to the Microsoft 365 admin center using an account with Global Administrator or Exchange Administrator roles.
Open your PowerShell terminal as an administrator and connect to Exchange Online by running the 'Connect-ExchangeOnline' cmdlet.
Run the command 'Get-Mailbox -PublicFolder -SoftDeletedMailbox' to display all recoverable public folder mailboxes.
Locate your specific public folder mailbox in the output list and check the exact deletion timestamp to guarantee it falls within the last 30 days.

Execute the Restore Command Using Updated PowerShell Syntax
Run the correct PowerShell cmdlet to restore the mailbox, ensuring your Exchange module is fully up to date to avoid syntax errors.
Discover a Lighter, Highly Compatible Office Solution with WPS Office
While managing Exchange Online enterprise environments requires complex Microsoft administrative tools, your daily document and data management shouldn't be difficult. WPS Office offers a free, lightweight suite that seamlessly integrates with your workflow, allowing you to manage exported PowerShell logs and admin reports with ease.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button to get the lightweight installer.
- 2. Install WPS Office: Run the downloaded file and follow the simple on-screen instructions to install the software on your device.
- 3. Manage Administrative Documents: Open WPS Spreadsheet or Writer to instantly view and edit your exported PowerShell logs, CSV reports, and IT documentation.

Frequently Asked Questions
How long is a soft-deleted public folder mailbox kept in Exchange Online?
By default, Exchange Online retains a soft-deleted public folder mailbox for 30 days. Once this 30-day grace period expires, the mailbox is permanently purged and can no longer be recovered using PowerShell cmdlets.
Why does the Undo-SoftDeletedMailbox command return an unsupported syntax error?
Syntax errors typically occur if you are running an outdated version of the Exchange Online PowerShell module, or if your connected account lacks the specific Exchange Administrator roles required to execute the Undo-SoftDeletedMailbox cmdlet.
Can I recover specific items from a soft-deleted public folder mailbox instead of the entire mailbox?
No, the Undo-SoftDeletedMailbox cmdlet only restores the entire public folder mailbox. If you need to recover specific items, you must restore the whole mailbox first or rely on eDiscovery if a compliance retention hold was placed on it prior to deletion.




