skip to Main Content

Permanently clear previous mailbox info

How to delete a mailbox in Office 365 without deleting the user? Removing the user completely means that the mailbox will be deleted, including OneDrive and SharePoint files. Instead, you want to keep the user and delete the mailbox because they have OneDrive or Sharepoint files. This article will show how to permanently clear previous mailbox info and keep the user identity in Office 365.


Migrating mailboxes to Office 365 is great when everything is tested and planned. But, 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 Azure AD 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 Azure AD Connect to the cloud.

Note: Microsoft provides the PermanentlyClearPreviousMailboxInfo parameter to delete the mailbox in Exchange Online and keep the user in the cloud.

How to permanently clear previous mailbox info

To delete the Exchange Online mailbox, follow the steps below:

1. Connect to Exchange Online PowerShell

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

PS C:\> Connect-ExchangeOnline

2. Get user information

Run the Get-User cmdlet to check the status.

PS C:\> Get-User | Select-Object Name,*Recipient*

Name          PreviousRecipientTypeDetails RecipientType RecipientTypeDetails
----          ---------------------------- ------------- --------------------
Richard Grant                  UserMailbox      MailUser    RemoteUserMailbox

3. Clear previous mailbox info

Run the Set-User cmdlet including -PermanentlyClearPreviousMailboxInfo parameter to delete the mailbox in the cloud. Type Y and press Enter.

PS C:\> Set-User -PermanentlyClearPreviousMailboxInfo

Are you sure you want to perform this action?
Delete all existing information about user Identity:''?. 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.
Do you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): Y

The mailbox is successfully deleted and the user identity is still available in the cloud.

Read more: Permanently delete users from Office 365 »


You learned how to permanently clear previous mailbox info. First, check the user identity. After that, run the PermanentlyClearPreviousMailboxInfo parameter to remove 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.



ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 8 Comments

    1. Can confirm that as of recently, Search-Mailbox has been completely removed as a valid cmdlet. And it looks like the only other way to delete email is with compliance searches, which are limited to 10 results at a time, as opposed to 10,000 before. Sucks.

  1. This DOES NOT work…i have a min hybrid, mailbox created from scratch, not migrated, just ran this command hoping for quick way out of jail…nada. btw. here is the get-user output for this mbx:

    Name PreviousRecipientTypeDetails RecipientType RecipientTypeDetails
    —- —————————- ————- ——————–
    AAAAAAAAAAAA None UserMailbox UserMailbox

    @Ali Tajran your articles are excellent quality, hope you can spare another tip here, thx!

  2. With this process, I understood that the user’s mailbox, onedrive data was reset, but there was no action for me, does it take a certain time?

    I applied it to the test user 3 days ago, the user’s mails are still standing. is there something i’m missing?

  3. Hello Ali,

    I removed the license on O365 mailbox, expecting that the mailbox will be removed from admin console, but I still see the mailbox in console, I checked mailbox properties though powershell, IsMailboxEnabled and IsValid are TRUE. How to get the mailbox removed from admin console once the license is removed.

  4. Echoing Pete’s earlier comment, I’ve found several of your articles to be extremely helpful Ali!

    If I do -PermanentlyClearPreviousMailboxInfo, can I re-add the mailbox after? We did a pilot migration from Google and were told the user wanted 6-8 other mailboxes as aliases, so migration essentially merged them all into his. Now it’s been decided they want the other accounts to go to Shared Mailboxes instead, which we plan to do by setting up the other accounts as Shared and then re-migrating the mailboxes, but I first need to clear this merged mailbox from 50 Gb down to nothing to start again (we’ve already migrated things to the user’s OneDrive and they have made many changes since then, so don’t want to remove the whole user and re-add). I’m thinking I can do the set-user with -PermanentlyClearPreviousMailboxInfo option to purge the mailbox, calendar, and contacts, but can I then re-enable the Mailbox functionality through either PS or Admin Center?

  5. Hello Ali

    I search and search and then I find your articles – and they always work. Excellent sir. You have the best info for Exchange Online.
    You are helping people all over the world with your articles. Keep it up.

    One thing I still find missing on Office365 for admins is : “Microsoft should have included a TEST MAIL button somewhere, where it could run several tests against the mailbox to make sure it is active, has a license, quota is ok etc. etc. This would be awesome.

  6. Hello.
    Thanks for sharing your info. If possible, please write in the post about deleting clients’ emails in exchange 2016 in a specific time period to create more free space. Thankful

Leave a Reply

Your email address will not be published. Required fields are marked *