While managing the mailboxes or performing maintenance tasks on Exchange Server, it might happen that you accidentally delete a mailbox. You may also delete mailbox to free some storage, when an employee leaves the company, or for any other reason. However, when you delete a mailbox, it is not immediately removed from the server. It remains on the server as a disconnected mailbox until the retention period (which is usually 30 days) is over. This means that you can recover the deleted mailbox, if required, within the retention period. Below, we will explain how to recover deleted mailbox from Exchange Server. But before proceeding, let's understand the mailbox retention policy in Exchange Server.
What is the Mailbox Retention Policy in Exchange Server?
In Microsoft Exchange Server, retention policy is used for managing the lifecycle of mailboxes and mailbox items. This policy defines for how long the deleted mailboxes and emails will be retained before being permanently deleted or purged. By default, the deleted mailboxes are retained for 30 days and the deleted emails are retained for 14 days. However, you can modify the retention policy to increase the retention period. To change the retention policy for a specific mailbox, you need to first create a new retention policy tag. For this, you can use the command as given below:
The above command will create a new retention policy tag - named DeleteAfter1Year.
Once the retention policy tag is created, you need to create a new retention policy using the new tag. For this, use the command as given below:
The above command will create a new retention policy - named 1YearPolicy using the DeleteAfter1Year policy tag. Any mailbox that is assigned with this retention policy will be retained for a period of 1 year (365 days) after deletion, before being purged.
To assign the retention policy to a mailbox, you can use the command as given below:
The above command will assign the retention policy - 1YearPolicy - to the user anubhuti.
Now, let us look at the process to restore deleted/disconnected mailbox from the Exchange Server.
Prerequisites to Recover Deleted Exchange Mailbox
When you delete a mailbox, the associated Active Directory user account is also deleted. So, you need to connect the deleted mailbox to an Active Directory user or create a new user and then recover it. However, in case of a disabled mailbox, you only need to connect it to an Active Directory user. Before connecting, you need to first locate the disconnected or deleted
$dbs = Get-MailboxDatabase
$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisplayName -eq "
For disabled mailboxes, the DisconnectReason field in the output will display the value as Disabled. Similarly, for deleted mailboxes, it will display the value as Deleted.
Now, you need to connect the deleted mailbox to a user account in the Active Directory. You can use Exchange Admin Center (EAC) to connect the deleted mailbox. Here are the steps:
- Open EAC and go to Recipients > Mailboxes.
- Click the More Options > Connect a mailbox.
- You will see a list of disconnected mailboxes on the selected Exchange Server.
- Select the deleted mailbox you want to connect to the user account and click Connect.
- Click on the Yes, connect to the user account above option to connect the mailbox to the user if the user exists. Otherwise, choose No, I want to connect to a different user account to connect mailbox to a new AD user account.
- If you click the Yes option, the mailbox will be restored to the existing mailbox.
- If you click the No option, then you need to select the new AD user account from the list to connect the mailbox.
Alternatively, you can use the PowerShell command in Exchange Management Shell (EMS) to connect the deleted mailbox. You can use the Connect-Mailbox command as given below:
This command will connect the disconnected user mailbox to a non-mail-enabled user account.
Methods to Recover Deleted/Disconnected Exchange Mailboxes
Here are the methods that you can use to restore deleted mailboxes in the Exchange Server.
Method 1: Use the New-MailboxRestoreRequest PowerShell Cmdlet
You can recover the deleted Exchange mailbox by using the New-MailboxRestoreRequest PowerShell cmdlet (see the below example).
The AllowLegacyDNMismatch parameter used in the command will recover the source mailbox to a different mailbox that does not have the same legacy DN value.
The above command will restore the deleted mailbox to the target mailbox - 'Debra Garcia.'
To view the status of restore process, you can use the Get-MailboxRestoreRequest cmdlet.
Once the process is complete, the deleted mailbox will be recovered to the chosen source mailbox.
To verify if the mailbox has been restored successfully, you can run the following command:
If the command output displays the UserMailbox value for the RecipientType property, it indicates that the user account and the mailbox are connected.
Method 2: Use Windows Server Backup
If you create regular backups using Windows Server Backup (WSB), then you can restore the deleted Exchange mailboxes from the backup. Here are the steps to recover deleted Exchange Mailboxes using WSB:
- Open the Windows Server Backup.
- Click on Recover.
- Choose the location to store the backup and click Next.
- Choose the date of backup you want to use for recovery and click Next. (Make sure to choose a backup that was created before the mailbox was deleted.)
- Choose the location where you want to recover the backup and click Next. This will start the restoring process.
Once the restore process is finished, you can use the recovered database as recovery database (RDB) and extract the deleted mailbox.
Alternative Solution to Recover Deleted Exchange Mailboxes
An easy and quick way to recover deleted Exchange mailboxes is by using an advanced Exchange recovery software, such as Stellar Repair for Exchange. This Exchange recovery software can easily recover deleted mailboxes (that are still in their retention period) from Exchange database (EDB) files. You need to just scan the EDB file (from where the mailboxes were deleted) by using the software and it will list all the mailboxes and other items, including the deleted mailboxes, on the screen. You can then select the deleted mailboxes and directly export them to a live Exchange Server database. The software can also save the users mailboxes, archives, public folders, and other Exchange database items in PST format. It can also export the EDB file items to Microsoft 365 account.
Conclusion
Above, we have explained the stepwise process to recover the deleted mailboxes from backup and using the Exchange native tools - Exchange Admin Center (EAC) and Exchange Management (EMS). However, restoring the deleted mailboxes via Exchange Admin Center (EAC) or Exchange Management (EMS) is quite tedious and time-consuming. As an alternative, you can use an Exchange recovery software, like Stellar Repair for Exchange. It can help you to restore deleted mailboxes (still in their retention period) in just a few simple steps. It also allows you to create a new user, map the recovered mailbox, and then directly export it to the newly created mailbox.