logo
search
Others

How to Permanently Delete an Exchange Online Mailbox

Huma Ashraf ChHuma Ashraf Ch Oct 1, 2026 869 views

Question details

A Microsoft 365 administrator needs to permanently delete an Exchange Online mailbox while retaining the associated user account for other services.

How to Permanently Delete an Exchange Online Mailbox
Product
Exchange Online
Device & OS
not provided
Scenario
Managing Microsoft 365 licenses and mailboxes for cloud-only and synchronized hybrid user accounts.
Observed behavior
The administrator requires a method to permanently purge a mailbox and clear previous mailbox info via PowerShell without removing the underlying Active Directory or Microsoft 365 user account.
Before you start

Ensure you have the Exchange Online PowerShell module installed and possess global administrator or Exchange administrator privileges. Verify your environment type, as the process for cloud-only accounts differs significantly from hybrid environments.

Solution 1Recommended

Permanently Delete Mailbox for Cloud-Only and Synchronized Accounts

Use this method to permanently clear mailbox information for accounts that are fully managed in the cloud or synchronized without an active hybrid Exchange environment.

This process requires you to first remove the user's Exchange Online license so the mailbox enters a soft-deleted state. Once soft-deleted, you can permanently purge the mailbox using PowerShell.

Warning: This action is permanent and cannot be undone. All emails, calendar items, and contacts in the mailbox will be permanently destroyed.

1
Remove the Exchange Online License

Log in to the Microsoft 365 Admin Center, navigate to 'Users' > 'Active users', select the specific user account, and uncheck their Exchange Online license under the 'Licenses and apps' tab. Save the changes.

2
Wait for Soft-Deletion

Allow up to 30 minutes for the Microsoft 365 system to process the license removal. The mailbox will automatically transition into a soft-deleted state.

3
Connect to Exchange Online PowerShell

Open Windows PowerShell as an administrator and execute the command 'Connect-ExchangeOnline' to securely authenticate with your Microsoft 365 tenant.

4
Clear Previous Mailbox Information

Run the command 'Set-User "user@example.com" -PermanentlyClearPreviousMailboxInfo' (replacing the email address with the target user's UPN). This command permanently purges the mailbox while keeping the user account intact for services like Teams or OneDrive.

Permanently Delete Mailbox for Cloud-Only and Synchronized Accounts
Verification: You can verify the mailbox is permanently deleted by attempting to run 'Get-Mailbox' for the user; it should return no active mailbox results.
Free Microsoft Office alternative

Empower Your Team with WPS Office

While you manage complex Microsoft 365 backend environments like Exchange Online, consider offering your organization a lightweight, highly compatible alternative for their daily document processing needs. WPS Office provides professional-grade tools for text documents, spreadsheets, and presentations without the heavy overhead.

Seamless format compatibility with Microsoft Word, Excel, and PowerPoint (.docx, .xlsx, .pptx)Lightweight client ensuring fast startup times even on older hardwareFamiliar ribbon interface that requires zero employee retrainingFree version available with robust features for everyday office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Can I undo the PermanentClearPreviousMailboxInfo command?

No. Once you run the -PermanentlyClearPreviousMailboxInfo parameter, the mailbox and all its contents are permanently purged from Microsoft's servers. It cannot be recovered from the recycle bin or via eDiscovery.

What happens if I just remove the license without running the PowerShell command?

If you only remove the Exchange Online license, the mailbox enters a 'soft-deleted' state. It will be retained in the system for 30 days by default, during which it can be fully recovered by reassigning the license, before being permanently deleted automatically.

Will deleting the Exchange mailbox break the user's Microsoft Teams access?

The user will still be able to sign in to Microsoft Teams as long as their Azure AD account remains active and they have a Teams license. However, features that rely on Exchange, such as calendar syncing, scheduling meetings, and accessing voicemail, will be severely degraded or unavailable.

Why am I getting an error running Set-User in my hybrid setup?

In hybrid environments, user attributes are authoritative on-premises. If you attempt to manipulate the mailbox state directly in Exchange Online, Microsoft 365 will block it to prevent directory sync conflicts. You must manage the mailbox via your on-premises Exchange Management Shell using commands like Disable-RemoteMailbox.