When an employee leaves your company for whatever reason, one of the most prudent steps that you can take is to delete the mailbox.  But keep in mind that the actual act of deletion does not necessarily mean that it is gone forever.  It is not, and there are numerous ways in which it can be restored, both from the GUI and Command Line perspectives.

This is the focal point of this article.

How To Restore A Deleted Mailbox Via the GUI

It is important to note that there are two types of deletions in the world of M365, which are as follows:

  • A Soft Delete:

When you initially delete a mailbox, it still remains in M365 for a maximum period of 30 days.

  • A Hard Delete:

This is when the mailbox has passed the 30-day expiration mark and is thus entirely purged from M365.

Note that anybody cannot simply restore a deleted mailbox.  Only the M365 license holder that possesses global administrative privileges can accomplish this task.  Here is how it is done from the GUI perspective:

  1. Log into the M365 Administration account by going to this link:  portal.microsoft.com.  After you have successfully logged in, navigate to the M365 Admin Center, and from there, go to Users, then click on Admin, as seen below:

    (SOURCE:  1).
    Towards the bottom, you will see a menu choice that says, “Deleted Users.”  Click on that, and you will see the list of deleted mailboxes.
  2. Now, you will see an option that says “Restore User”:

    (SOURCE:  1).
    Now, click on the “Restore user” option to initiate the restoration process of the deleted mailbox “TestAcct1”.A series of other steps will be also be conducted from within M365, which are as follows:
  • All information/data associated with the returning employee will be restored again with respect to what was contained in their mailbox.
  • If there is not a license already established with the deleted mailbox, then a new one will be created.
  • The original rights, permissions, and other related services that the employee had before will also be restored as well.
  1. After you have started the restoration process, a new dialog will then appear, which confirms the above three steps.  Also, you will be prompted on how you want to create a new password for the returning employee.  For the most part, the best options to choose are to auto-generate a password, and from there, make sure the employee changes that initial password after the first logon, as seen below:

    (SOURCE: 1).
    After making the appropriate selection, then click on the “Restore” button to finish the restoration process of the deleted mailbox.
  2. Once the deleted mailbox has been successfully restored, you will then get a confirmation like this:

    (SOURCE:  1).
    Finally, click on “Send email and close”.  This will notify the recipient that the original mailbox has been restored, as well as its respective login information.

How To Restore A Deleted Mailbox Via the Command Line

In this instance, you will use the PowerShell scripting language in order to restore a deleted mailbox.  To do it this way, follow these steps:

  1. Connect to Microsoft Exchange Online.  For more detailed instruction on how to do this click here.
  2. Launch and execute the “Undo-SoftDeletedMailbox” cmdlet, as can be seen below:
    Undo-SoftDeletedMailbox testuser@example.com -WindowsLiveID testuserb@example.com -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)
  3. In order to confirm that the deleted mailbox has indeed been restored, initiate the following command:
    Get-Mailbox testuser@example.com

Sources

  1. https://adamtheautomator.com/restore-mailbox-office-365/
  2. https://docs.microsoft.com/en-us/exchange/recipients-in-exchange-online/delete-or-restore-mailboxes