Hard delete mailbox without deleting user account in Microsoft 365 (2024)

How to hard delete a mailbox in Microsoft 365 without deleting the user account? Removing the user completely means that the mailbox, including the Teams, OneDrive, and SharePoint files, will be deleted. Instead, you want to keep the user and delete just the mailbox, leaving everything else. This article will show how to permanently clear previous mailbox info and keep the user identity in Microsoft 365.

Table of contents

  • Clear Exchange Online mailbox info
  • How to hard delete mailbox in Microsoft 365
    • 1. Connect to Exchange Online PowerShell
    • 2. Remove Exchange Online license
    • 3. Get user mailbox status
    • 4. Clear previous mailbox info
    • 5. Get mailbox deletion status
  • Conclusion

Clear Exchange Online mailbox info

Migrating mailboxes to Microsoft 365 is great when everything is tested and planned. However, it can happen that you will find a mailbox on-premises and a mailbox in the cloud for the same user identity. When this occurs, it means that something went wrong with the Microsoft Entra Connect Sync between on-premises and the cloud. So, it’s essential to fix that because mail flow issues will happen if you don’t.

These issues happen when you add an Exchange Online license to an on-premises mailbox before it’s synced with Microsoft Entra Connect Sync to the cloud.

Another reason is that you have a Microsoft 365 cloud-only organization, and you want to delete all the information from the mailbox.

Note: Microsoft provides the PermanentlyClearPreviousMailboxInfo parameter to delete the mailbox in Exchange Online and keep the user account in the cloud. This works for a Hybrid and cloud-only environment.

How to hard delete mailbox in Microsoft 365

To delete the Exchange Online mailbox and keep the user account, follow the steps below:

1. Connect to Exchange Online PowerShell

Run Windows PowerShell as administrator and Connect to Exchange Online PowerShell.

Connect-ExchangeOnline

2. Remove Exchange Online license

When you remove a license from a mailbox, it means that you soft-deleted the mailbox. It stays in a soft-delete state for 30 days, after which it will be automatically deleted. If you add the Exchange Online plan to the mailbox, the mailbox will connect to the user, including all the mailbox information.

To remove an Exchange Online license from a user in Microsoft 365, follow these steps:

  1. Sign in to Microsoft 365 admin center
  2. Expand Users > Active Users
  3. Click on the User
  4. Click on Licenses and apps
  5. Expand Apps
Hard delete mailbox without deleting user account in Microsoft 365 (1)
  1. Uncheck the Exchange Online license
  2. Click Save changes
Hard delete mailbox without deleting user account in Microsoft 365 (2)
  1. You can get an error message that you need to remove other apps

In our example, we must remove Microsoft Defender for Office 365 (Plan 2) and Microsoft MyAnalytics (Full).

Hard delete mailbox without deleting user account in Microsoft 365 (3)
  1. Uncheck the apps
  2. Click Save changes

3. Get user mailbox status

Run the Get-User cmdlet to check that no mailbox is connected to the user.

Get-User "Richard.Grant@exoip.com" | Select-Object Name,*Recipient*

The output shows that the user has a mailbox, that’s because you should give it a few minutes time for the changes to be applied.

Name PreviousRecipientTypeDetails RecipientType RecipientTypeDetails---- ---------------------------- ------------- --------------------03e95a20-3652-4895-af25-6deed0856081 None UserMailbox UserMailbox

Keep running the command until you see the below output.

Name PreviousRecipientTypeDetails RecipientType RecipientTypeDetails---- ---------------------------- ------------- --------------------03e95a20-3652-4895-af25-6deed0856081 UserMailbox MailUser MailUser

Another command that you can run is the Get-Mailbox.

Get-Mailbox "Richard.Grant@exoip.com"

The output shows that the user mailbox couldn’t be found, which is correct because the Exchange Online license was removed.

Get-Mailbox: Ex6F9304|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException|The operation couldn't be performed because object'richard.grant@exoip.com' couldn't be found on 'AM0P195A003DC04.EURP195A003.PROD.OUTLOOK.COM'.

Now that we have verified that the user does not have a mailbox attached, we can proceed to the next step.

4. Clear previous mailbox info

Run the Set-User cmdlet, including the -PermanentlyClearPreviousMailboxInfo parameter, to hard delete the mailbox without deleting the user account in Microsoft 365.

Important: The Exchange Online mailbox will be PERMANENTLY deleted with the below command, and its unrecoverable.

Set-User "Richard.Grant@exoip.com" -PermanentlyClearPreviousMailboxInfo

The below message appears in the output. Press Y and Enter to confirm the action.

ConfirmAre you sure you want to perform this action?Delete all existing information about user Identity:'Richard.Grant@exoip.com'?. This operation will clear existing values from Previous home MDB and Previous Mailbox GUID of the user. After deletion, reconnecting to the previous mailbox that existed in the cloud will not be possible and any content it had will be unrecoverable PERMANENTLY. This operation will also create an async task to purge all the mail data. You can check the status by running 'Get-User <Identity> | fl *Workload*' and check if DesiredMailboxWorkloads is set to null. Do you want to continue? Y

5. Get mailbox deletion status

The mailbox will not be deleted immediately. An excellent way to know when the mailbox is hard deleted is to run the below command.

Get-User "Richard.Grant@exoip.com" | fl *WorkLoad*

The DesiredMailboxWorkloads property shows the value Substrate.

MailboxWorkloads : Mail, Calendar, Contacts, SubstrateDefaultMailboxWorkloadsMask : Mail, Calendar, Contacts, SubstrateDesiredMailboxWorkloads : SubstrateDesiredMailboxWorkloadsModified : 18/04/2024 11:20:20DesiredMailboxWorkloadsGracePeriod : None

The value needs to be empty (Null). You can keep running that command until you see the empty value. In our example, the value changed to empty after 8 hours.

MailboxWorkloads : Mail, Calendar, Contacts, SubstrateDefaultMailboxWorkloadsMask : Mail, Calendar, Contacts, SubstrateDesiredMailboxWorkloads : DesiredMailboxWorkloadsModified : DesiredMailboxWorkloadsGracePeriod : 

The mailbox is successfully deleted and the user identity is still available in Microsoft 365. In an Exchange Hybrid environment this is the message you will see when you click on Mail.

Hard delete mailbox without deleting user account in Microsoft 365 (4)

You can now migrate a mailbox or assign the Exchange Online license to the user. Remember that the user will get a new mailbox.

Read more: Permanently delete users from Microsoft 365 »

Conclusion

You learned how to hard delete mailbox without deleting the user account in Microsoft 365. First, remove the Exchange Online license assigned to the user and verify that the mailbox is disconnected. After that, run the PermanentlyClearPreviousMailboxInfo parameter to remove (hard-delete) the mailbox from the cloud. But before you do that, ensure that you export the mailbox data, if there is any. Otherwise, the data will be deleted for good.

Did you enjoy this article? You may also like Mailbox type difference in Exchange Hybrid. Don’t forget to follow us and share this article.

Hard delete mailbox without deleting user account in Microsoft 365 (2024)
Top Articles
Privacy Policy
North Korean Hackers Accused Of ‘Biggest Cryptocurrency Theft Of 2020’—Their Heists Are Now Worth $1.75 Billion
Walgreens Boots Alliance, Inc. (WBA) Stock Price, News, Quote & History - Yahoo Finance
Greedfall Console Commands
Senior Tax Analyst Vs Master Tax Advisor
Txtvrfy Sheridan Wy
Santa Clara College Confidential
Steamy Afternoon With Handsome Fernando
Blairsville Online Yard Sale
Comcast Xfinity Outage in Kipton, Ohio
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
More Apt To Complain Crossword
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Craigslist Pets Longview Tx
Nalley Tartar Sauce
Dc Gas Login
Missouri Highway Patrol Crash
Ruben van Bommel: diepgang en doelgerichtheid als wapens, maar (nog) te weinig rendement
Huntersville Town Billboards
Curry Ford Accident Today
Busted Campbell County
Reptile Expo Fayetteville Nc
Wbiw Weather Watchers
Jeffers Funeral Home Obituaries Greeneville Tennessee
Red Cedar Farms Goldendoodle
Jobs Hiring Near Me Part Time For 15 Year Olds
Does Hunter Schafer Have A Dick
Amerisourcebergen Thoughtspot 2023
Weathervane Broken Monorail
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Craigslist Brandon Vt
Pronóstico del tiempo de 10 días para San Josecito, Provincia de San José, Costa Rica - The Weather Channel | weather.com
Why Are The French So Google Feud Answers
Mobile Maher Terminal
Eaccess Kankakee
ShadowCat - Forestry Mulching, Land Clearing, Bush Hog, Brush, Bobcat - farm & garden services - craigslist
Yoshidakins
Skroch Funeral Home
Maxpreps Field Hockey
Dmitri Wartranslated
Kelly Ripa Necklace 2022
The Thing About ‘Dateline’
Barstool Sports Gif
Xre 00251
Greatpeople.me Login Schedule
Hughie Francis Foley – Marinermath
Missed Connections Dayton Ohio
Craigslist Anc Ak
Makemkv Key April 2023
Www Extramovies Com
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 6147

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.