Restore Exchange Online user mailbox | Cloud only (Fully Hosted) environment | Article 3#3 | Part 10#23 5/5 (1) 10 min read

In the current article, we review the second option for restoring Soft Deleted Exchange Online mailbox.

In this scenario, we “Instantiate” the restore process by using a PowerShell command (Undo-SoftDeletedMailbox), that will restore the Soft Deleted Exchange Online mailbox, and also, create a NEW Office 365 user account that will associated with the recovered Exchange mailbox.

Restore Exchange mailbox | Article Series table of content | Click to expand

Restore Exchange Online deleted mailbox | Article Series

Exchange Online mailbox restore | Articles series table of content
Introduction to the subject of Exchange and deleted mailboxes
01Restore deleted Exchange Online mailbox in Office 365 environment | Prefix | Part 01#23
02Directory Object Deletion and the restore “domino effect + little bit about the concept of the Active Directory Recycle bin | Part 2#23
03What are the possible causes for an Exchange Online mailbox deletion? | Part 3#23
04What are the possible options for recovering Exchange Online mailbox? | Part 4#23
05The Index of the different Exchange Online mailbox restores methods| Part 5#23
Restoring Exchange Online mailbox – cloud only environment
06Restore Exchange Online Room mailbox | Cloud only (Fully Hosted) environment | Part 6#23
07Restore Exchange Online Shared mailbox | Cloud only (Fully Hosted) environment | Part 7#23
08Restore Exchange Online user mailbox | Cloud only (Fully Hosted) environment | Article 1#3 | Part 8#23
09Restore Exchange Online user mailbox | Cloud only (Fully Hosted) environment | Article 2#3 | Part 9#23
10Restore Exchange Online user mailbox | Cloud only (Fully Hosted) environment | Article 3#3 | Part 10#23
Restoring Exchange Online mailbox in Directory synchronization environment
11The special characters of Directory synchronization in an Office 365 environment | Article 1#2 | Part 11#23
12The special characters of Directory synchronization in an Office 365 environment | Article 2#2 | Part 12#23
Restoring user account – On-Premise Active Directory environment
13Deleted Active Directory User account and the Deleted object store | Basic introduction | Article 1#4 | Part 13#23
14How to restore Active Directory deleted user account (Active Directory recycle bin is not enabled) using LDP.EXE | Article 2#4 | Part 14#23
15How to restore Active Directory deleted user account (Active Directory recycle bin is not enabled) using AdRestore, AdRestore.net and LEX – the LDAP explorer | Article 3#4 | Part 15#23
16How to restore Active Directory deleted user account by using Active Directory recycle bin | Article 4#4 | Part 16#23
Restoring Exchange Online mailbox in Directory synchronization environment
17Restore Exchange Online USER mailbox | Directory synchronization environment | The “right way” | Part 17#23
18Prefix – the “Problematic” Exchange Online mailbox restores scenarios in Directory synchronization environment | Part 18#23
19Reviewing the characters of Exchange Online mailbox recovery mistake – New On-Premise Active Directory User Account was created | Part 19#23
20Reviewing the characters of Exchange Online mailbox recovery mistake – Soft Deleted Office 365 was restored | Part 20#23
21Solving an Exchange Online mailbox restore mistake by Restoring the original Soft Deleted Active Directory user | Part 21#23
22Restoring Exchange Online mailbox content to another mailbox using PowerShell command New-MailboxRestoreRequest | Part 22#23
23Solving an Exchange Online mailbox restore mistake Office 365 user was restored – removing the ImmutableID value | Part 23#23

In this method, we directly restore the Soft Deleted Exchange Online mailbox versus the conventional way, in which we restore the Office 365 user account that considers as the owner of the deleted Exchange Online mailbox (this method reviewed in the former article ).

The use of the PowerShell command Undo-SoftDeletedMailbox

The PowerShell command that we use for restoring the Soft Deleted Exchange Online mailbox is – Undo-SoftDeletedMailbox

We can use the PowerShell command Undo-SoftDeletedMailbox for two types of restoring scenarios:

Scenario 1#2 – restore the Soft Deleted Exchange Online + Create a NEW Office 365 user account.

Scenario 2#2 – restore the Soft Deleted Exchange Online, and connect the recovered Exchange mailbox to the original user account that considers as the mailbox owner.

The option that seems associatively the preferred option is – restoring the Exchange Online mailbox + restore the original Office 365 user account that associated with the mailbox.

As mentioned in a former article, this restore option, is not implemented properly in an Office 365 based environment. Maybe in the future, the “issue” will be fixed.

At the current time, my recommendation is to use the second option (Scenario 2#2) in which we use the Undo-SoftDeletedMailbox PowerShell command for:

  1. Recover the soft deleted Exchange Online mailbox.
  2. Creating a NEW Office 365 user account + Password.
  3. “Binding” the NEW Office 365 user account to the restored Exchange Online mailbox.

Restoring Exchange Online User mailbox – the flow of events

Before we start with the step by step instructions, a brief review of the “Restore process flow” in Office 365 and Exchange Online base environment.

When we restore a Soft Deleted Exchange mailbox, the following chain of events implemented:

Exchange Online infrastructure

  • Step 1#4 – Restoring the Exchange Online User mailbox. The status of the recovered Exchange Online mailbox is updated from – Soft Deleted mailbox to – “Active.”
  • Step 2#4 – Exchange Online synchronizes the “updated information” to Azure Active Directory infrastructure.

Azure Active Directory infrastructure

  • Step 3#4 – Azure Active Directory get the information about the change in the Exchange Online mailbox status (the fact the that Exchange Online mailbox was recovered).
  • Step 4#4 – Azure Active Directory creates a NEW user account and “bind” the user account to the Exchange Online User mailbox.

Restoring the Exchange Online USER mailbox - Chain of events

“Directly“ restore the Soft deleted Exchange Online mailbox by using the PowerShell command Undo-SoftDeletedMailbox

The PowerShell command implements the restore process of Soft Deleted Exchange Online mailbox in Office 365 based environments – Undo-SoftDeletedMailbox

The PowerShell command Undo-SoftDeletedMailbox logic and characters.

Undo-SoftDeletedMailbox for, restoring Soft Deleted Exchange Online mailbox, I would like to briefly review the syntax and the logic of the Undo-SoftDeletedMailbox command.

In our scenario, we use the PowerShell command – “Undo-SoftDeletedMailbox” for executing two tasks:

  1. Restoring the Soft deleted Exchange Online mailbox.
  2. Creating a NEW Azure Active Directory user account.

For this reason, the PowerShell parameters that we need to provide, relate to the name of the Soft Deleted Exchange Online mailbox that we want to restore + the parameters that relate to the NEW Azure Active Directory user account that will create.

In the following diagram, we can see the “two parts” of the Undo-SoftDeletedMailbox PowerShell command.

In the first part, we specify the name of the Exchange Online Soft Deleted mailbox that we want to restore (number 1).

In the second part, we need to provide information that will use for creating the NEW Azure Active Directory user account.

The parameter – WindowsLiveID, will use for the UPN (Principal User Name) of the new Azure Active Directory user account + as the primary E-mail address (number 2).

Besides, each Azure Active Directory user account should have a password.
For this reason, the second Azure Active Directory parameter that we need to provide is the user password.

The syntax of the Undo-SoftDeletedMailbox PowerShell command

An example of the PowerShell syntax is:

Note – the ability restores the Soft Deleted Exchange Online mailbox by using the PowerShell command Undo-SoftDeletedMailbox is based preliminary step, in which we need to connect Exchange Online using remote PowerShell.
In case that you need instructions how to create a Remote PowerShell session to Exchange Online, you can read the article – Connect to Exchange Online using PowerShell

Restoring a Soft Deleted Exchange Online User mailbox by using the PowerShell command – Undo-SoftDeletedMailbox

In our scenario, we will restore a Soft Deleted Exchange Online mailbox that was associated with Office 365 user named- Brad.

The PowerShell command syntax that we use in our scenario is:

In the following screenshot, we can see that the Exchange Online mailbox restore process successfully completed.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -01

Using the Verbose PowerShell parameter.

I have added to the PowerShell restore mailbox command, the parameter – Verbose.
Using the Verbose parameter, enable us to get additional information about “what happens behind the scenes.”
In our example, the additional information that we get from using the Verbose parameter:

VERBOSE: Creating mailbox “Bradp” with User Principal Name “Bradp@o365info.com” in organizational unit “EURPR05A001.prod.outlook.com/Microsoft Exchange Hosted Organizations/o365info2.onmicrosoft.com”.

Verify that the Exchange Online User mailbox restore process successfully completed

In case that the restore process successfully completed, the following objects should be restored:

  1. The mailbox – Brad, should appear in the Exchange Online Admin center, under the section
    of recipients \ resources.
  2. The user Brad should appear in the Azure Active Directory Admin Center, under the section of Active users.

Active Directory admin center – Active users

In the following screenshot, we can see that user “Brad,” was successfully restored.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -01

It’s important to emphasize that the “original owner” of the recovered Exchange mailbox (the Office 365 user account that was soft deleted) of the Room Mailbox, was not restored!

When we look in the Azure Active Directory – Deleted users section, we can see that the older user account – Brad, still exists.

This user account will automatically be deleted at the end of the 30-day period.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -02

The properties of the NEW user account

The important thing that I would like to emphasize is that the “Office 365 user account” is a NEW user account that doesn’t have any relationship to the “original user account” that deleted. For this none of the properties of the “former” user account will not be restored.

In the following screenshot, we can see that the NEW user account doesn’t have Office 365 license.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -03

Also, the user account “details” are empty because this is a NEW user account.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -04

2.1 – Assign Office 365 license to the new user account

To be able to “activates” the NEW user account that created, we will need to assign Office 365 license.

In our example, we select the properties of the “NEW Brad Office 365 user account” and assign the required license (E3 in our example).

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -05

In the following screenshot, we can see that the required license was assigned.

Restore the Soft deleted Exchange Online user mailbox using PowerShell - Undo-SoftDeletedMailbox -06

Verifying if the Soft Deleted mailbox was successfully restored.

Exchange Online admin center – recipients \ resources

We start the verification process of the restored Bob mailbox, by “visiting” the Exchange Online recycle bin.

Using the Exchange Online admin center

We will look at the Exchange Online recycle bin content by using the Exchange admin center.

The another option that we can use for viewing the content of the Exchange recycle bin is – by using the “Deleted mailboxes” menu in the Exchange Online admin center.

To be able to view the list of Soft Deleted mailboxes, use the following steps:

  • Login to Exchange Online admin page
  • On the left menu bar, select the menu – recipients
  • On the top menu bar, choose the menu – mailboxes
  • Click on the three dots icon
  • Choose the menu – Deleted mailboxes

Verifying Exchange mailbox successfully restored - PowerShell - Undo-SoftDeletedMailbox-01

In the following screenshot, we can see that “Brad Soft Deleted mailbox” doesn’t appear anymore in the Exchange Online recycle bin.

Verifying Exchange mailbox successfully restored - PowerShell - Undo-SoftDeletedMailbox-02

3.3 – Looking at the active Exchange Online mailbox list

To be able to verify if Bob’s mailbox was successfully restored, we will use the Exchange Online admin center.

In the following screenshot, we can see that Bob’s mailbox successfully restored, and now it appears in the standard (active) mailbox list.

Verifying Exchange mailbox successfully restored - PowerShell - Undo-SoftDeletedMailbox-01

3.4 – Verify that the mailbox permissions were successfully restored

In this section, we would like to verify if the mailbox permissions, that were assigned to the Bob mailbox before the deletion of his mailbox deleted .

A quick reminder, before Bob’s mailbox, was deleted, Brad had Full access permissions on Bob’s mailbox.

In the following screenshot, we can see that we look at “Bob restore mailbox” properties, using the mailbox delegation menu; we can see that Brad had Full access permissions on Bob’s mailbox. The meaning is that the mailbox permissions successfully restored.

Verifying permissions Exchange mailbox restored mailbox - Undo-SoftDeletedMailbox-02

Restore Exchange Online mailbox | Article series index

Now it’s Your Turn!
It is important for us to know your opinion on this article

Print Friendly

Related Post

Please rate this

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

Leave a Reply

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