Knowing how to recover disconnected or straight up deleted mailboxes could come very handy, this article goes through the possible scenarios and gives a simple step-by-step guidance on the recovery process.
1. Retention period - while it's not too late
First of all, we need to clarify one thing: if a mailbox is disconnected or deleted for some reason, it is not gone for good. All Exchange databases retain deleted mailboxes for a specific period of time, which is 30 days by default. That means you have 30 days to recover a delete mailbox before it is purged from the live Exchange system, after which you'll need to use your older backups of the Exchange databases to restore the mailbox. A guide on that is coming.
Checking the set retention time on the databases
PS C:\> Get-MailboxDatabase | ft Name, MailboxRetention Name MailboxRetention ---- ---------------- DB01 30.00:00:00 DB02 30.00:00:00 …
2. Restore simply Disconnected mailboxes
a. How is a mailbox disconnected?
You disconnect a mailbox when a certain user doesn't need a mailbox anymore, but the user's AD account needs to be retained.
A mailbox is disconnected using the Exchange Control Panel (ECP) or the Shell.
Using ECP
Select the mailbox, then click on the '…' button in the menu bar. Choose "Disable"
Using the Shell is even simpler:
PS C:\> Disable-Mailbox "AbigailLove"
b. Recover the disconnected mailbox
Using ECP
In the menu bar click on '…' and select the "Connect a mailbox" option
Select the existing user account to connect the mailbox to. If the mailbox needs to be connected to another user, click here for that guide.
Using the Shell:
# Iterate through all databases to find the disconnected mailboxes PS C:\> $AllDatabases = Get-MailboxDatabase PS C:\> $AllDatabases | % {Get-MailboxStatistics -Database $_.DistinguishedName} | ? {$_.DisconnectReason -like 'Disabled'} | fl DisplayName,MailboxGuid,LegacyDN,Database DisplayName : Abigail Love MailboxGuid : 048ff09d-4fde-4369-a48e-f9cdaada5b96 LegacyDN : /o=alwayshotcafe/ou=exchange administrative group (fydibohf23spdlt)/cn=recipients/cn=9234a3b0362e4a239729560df7145161-abigail lo Database : DB01 # Once it is found, connect it back to the original user PS C:\> Connect-Mailbox -Identity "048ff09d-4fde-4369-a48e-f9cdaada5b96" -Database "DB01" -User "Abigail Love" PS C:\>
3. Accidentally deleted Mailboxes
A mailbox always gets deleted when the corresponding user account from Active Directory is gone. For example, an admin might accidentally delete Alice user from AD, then the mailbox disappears naturally.
To recover that we need to restore the user account to which it was connected to before.
Here we have two options: if Active Directory Recycle Bin is enabled in the system, we simply restore the user using ADAM (Active Directory Administrative Center) and the mailbox gets automatically re-connected to the user.
Recover with ADAM:
When a user is deleted, the mailbox disappears from the mailboxes list and gets in a disabled state. As soon as the user is restored, the mailbox reappears straight away.
To accomplish that, open the Active Directory Administrative Center. Locate the [domain]/Deleted Objects container, right-click on the deleted user and select "Restore".
Recovery when AD Recycle Bin is not enabled
If AD RB is not set, the mailbox also gets in a disabled state. Even though the user account is deleted it still present in AD, represented with it's tombstone.
To recover it, use the following PS commands:
PS C:\> Get-ADObject -Filter {Name -like "Alice*"} -IncludeDeletedObjects Deleted : True DistinguishedName : CN=Alice,OU=Users,OU=My Business,DC=AlwaysHotCafe,DC=com Name : Alice DEL:874bcd2b-148d-47ca-b309-91df64f05bf5 ObjectClass : user ObjectGUID : 874bcd2b-148d-47ca-b309-91df64f05bf5 PS C:\> Restore-ADObject 874bcd2b-148d-47ca-b309-91df64f05bf5 -NewName Alice
Comments