How to Restore a Mailbox in Exchange Server


Deleting a mailbox becomes crucial in several instances where you need to optimize server space or clear the mailboxes of off-boarded employees, etc. Nevertheless, you may often need to restore the mailboxes, especially if the deletion happened accidentally. 

Luckily, the restoration is possible, as a deleted mailbox remains in the Exchange Server database as a “disconnected mailbox” for 30 days from the date of deletion. During this retention period, the mailbox remains in a “soft-deleted” or disabled state. It enables the admins to restore or reconnect the deleted mailbox before its permanent purging happens. 

Reconnecting will restore the original mailbox to a user account without modifying the data. Likewise, restoring the mailbox will involve copying its data to an existing user account or a newly created mailbox in case of a deleted original user account. You can connect a deleted mailbox with a user account using Exchange Admin Center (EAC) or through Exchange Management Shell.

You can restore the deleted mailboxes through EMS. However, the restoration is not possible by using the Exchange Administration Center. As a better and hassle-free move, admins also prefer using Exchange recovery software to ensure hassle-free mailbox restoration. Here is a detailed insight into this discussion.

Why delete mailboxes in the Exchange Server

Several reasons can require you to delete a user mailbox in the Exchange server. 

  • Free the database space to accommodate fresh mailbox data. 
  • Remove the inactive data of former employees 
  • Comply with the data retention policies. 
  • Set the database free from inactive or disconnected mailboxes
  • Optimize the storage requirements in the Exchange server.
  • Avoid the instances of orphaned mailboxes
  • Ensures a data-secure environment in the organization


What Happens When You Delete a Mailbox in Exchange Server?

Deleting a mailbox may also delete the associated Active Directory (AD) user account. As the mailbox loses its association with the user account in the Exchange Server, it becomes disconnected. Usually, two types of disconnected mailboxes exist. 

Disabled mailboxes

When the admin removes a mailbox from a user account by using the Disable-Mailbox cmdlet, a few things happen:

  • The mailbox enters the disabled state. 
  • The AD user account remains unaffected,  
  • The mailbox gets disconnected while still residing in the Exchange database 


Soft-deleted mailboxes

Soft-deletion happens when you delete a mailbox or the associated user account through the Remove-Mailbox cmdlet, or when the mailbox shifts to another database. In such cases, it remains stored in the source mailbox database temporarily, during which you can recover it.

In both cases, the disconnected mailbox remains in the source database until the retention period of 30 days from the date of deletion expires. Besides, using Remove-StoreMailbox will also purge the mailbox, deleting it permanently. You can connect these disconnected mailboxes to a user account within this duration. 

Connect a deleted mailbox through EAC and EMS

Let’s connect a deleted mailbox by using these two methods, one after another.

Connect a deleted mailbox using EAC

Here are the steps:

  • Log in to your EAC account  
  • Navigate to Recipients > Mailboxes
  • Click three dots (…) > Connect a mailbox
  • This will show a list of disconnected mailboxes on your selected Exchange Server, including deleted, disabled, and soft-deleted mailboxes.
  • Click the deleted mailbox that you wish to connect to
  • Next, click Connect to see a window that enquires if you are sure to connect the mailbox
  • Click Yes to see a list of user accounts that are not mail-enabled.
  • Look for the user to whom you want to connect the deleted mailbox, click the user, and then click OK.
  • This will connect the deleted mailbox to the selected user account in the Exchange Server


Connect a deleted mailbox using EMS

Admins use the Connect-Mailbox cmdlet to connect a deleted mailbox to a user account that does not have the mail-enabled state. Connecting a resource, shared, or linked mailbox will disable the AD user account to which you are linking it. Here are the examples:

Example 1: It uses the Connect-Mailbox cmdlet to connect a linked mailbox.

Connect-Mailbox -Identity “Temp User” -Database EXDB02 -LinkedDomainController FabrikamDC01 -LinkedMasterAccount [email protected] -Alias dpark

Parameter description:

  • Identity: Informs about the deleted mailbox on the mailbox database EXDB02
  • LinkedMasterAccount: Specifies the AD user account that you wish to connect to
  • LinkedDomainController: Tells about a domain controller in the account forest. 

Example 2: Connects a shared mailbox.

Connect-Mailbox -Identity “Printer Support” -Database MBXDB01 -User “Corp Printer Support” -Alias corpprint -Shared

You can connect a deleted or disconnected mailbox to a user account. But the connected user account will not have a mailbox associated with it. This will eventually need you to restore the deleted mailbox.

How to restore a deleted mailbox using the EMS?

Administrators use the New-MailboxRestoreRequest cmdlet to restore a deleted mailbox to an existing Exchange database mailbox. The command copies the contents of the deleted mailbox to the targeted mailbox. To proceed, you will require several important details of the deleted mailbox, including 

  • Display name
  • Legacy distinguished name or LegacyDN
  • Mailbox Guid

To get this information, you will have to run the Get-MailboxDatabase cmdlet. Here is the example:

$dbs = Get-MailboxDatabase

$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq “Disabled”} | Format-Table DisplayName,MailboxGuid,Database,DisconnectDate

After fetching the requisite information, use the New-MailboxRestoreRequest to restore the deleted mailbox to a target (active) mailbox. 

Example 1:

 New-MailboxRestoreRequest -SourceStoreMailbox e4890ee7-79a2-4f94-9569-91e61eac372b -SourceDatabase EXDB001 -TargetMailbox “Allan Donald” -AllowLegacyDNMismatch

Description:

  • SourceStoreMailbox: Deleted mailbox – e4890ee7-79a2-4f94-9569-91e61eac372b –
  • Source Database: EXDB001
  • TargetMailbox: Allan Donald (Mailbox to restore the deleted mailbox)
  • AllowLegacyDNMismatch: Parameters to restore the source mailbox to a target mailbox with a different legacyDN value.

Example 2

 New-MailboxRestoreRequest -SourceStoreMailbox “Personal Archive – Mark Twain” -SourceDatabase “EXDB001” -TargetMailbox [email protected] -TargetIsArchive

Description

This example restores the deleted archive mailbox of the mailbox user Mark Twain from the source database EXFB001 to his existing archive mailbox, [email protected]


Drawbacks of restoring a mailbox in Exchange Server manually

Despite the ability to restore the deleted mailboxes to the target mailboxes, the manual methods have certain limitations:

  • The database consisting of the deleted mailbox should be mounted on the server
  • The manual method will not work in case of a corrupted database
  • It consumes considerable time and requires you to possess adept technical knowledge.
  • You need to be careful while using manual methods, such as PowerShell commands, across different versions.

Due to these restrictions, the manual methods invite significant hassle and require prompt attention. This is where Exchange server recovery software can help.


Restore a Mailbox in Exchange Server using software

Using automated third-party software gives you an upper hand over the manual mailbox recovery and restoration methods owing to multiple reasons:

  • Recovers all the mailboxes and the contained emails deleted accidentally or intentionally
  • Restore EDB files without any threat of data loss
  • Option to repair corrupt public folders
  • Export EDB files and public folders directly to Office 365 or Live Exchange Server
  • Filter options to exclude or include selected email items when exporting to PST or Live Exchange Server

These and many more advantages encourage admins to use automated third-party applications for mailbox recovery in the Exchange Server instead of opting for manual methods. Stellar Repair for Exchange is a widely accepted option in this context.


Conclusion

You may require deleting the mailboxes in the Exchange Server databases to clear server space, removing data for offboarded employees, or for other reasons. However, there may arise a need to restore these mailboxes when deleted accidentally. As the deleted mailbox resides in the Exchange Server database for 30 days, you may restore or reconnect to a user account within this retention period. 

To reconnect the disconnected mailboxes (soft-deleted or disabled) to a user account, you can use EMS or EAC. However, to associate a mailbox with the connected user account, you will have to restore the deleted mailbox. This is possible by using the New-MailboxRestoreRequest cmdlet in the EMS environment with the help of the Get-MailboxDatabase cmdlet

While these manual procedures help to restore the deleted mailboxes, it entails several limitations. For example, the methods consume too much time, cause data loss, do not guarantee complete resolution, and need in-depth technical expertise. To avoid such issues, admins prefer using Exchange server recovery software. Among the many tools available for this purpose, Stellar Repair for Exchange is a feasible option.