• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » Restore Deleted Exchange Mailboxes

Restore Deleted Exchange Mailboxes

June 9, 2020 - by Zsolt Agoston - last edited on June 10, 2020

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.

If a mailbox is DELETED, the user's AD account is also deleted by Exchange! To keep the user account, always DISCONNECT the mailbox instead of deleting it!

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"

Restore Deleted Exchange Mailboxes

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

Restore Deleted Exchange Mailboxes

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.

Restore Deleted Exchange Mailboxes

To accomplish that, open the Active Directory Administrative Center. Locate the [domain]/Deleted Objects container, right-click on the deleted user and select "Restore".

Restore Deleted Exchange Mailboxes

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

Reader Interactions

Comments Cancel reply

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

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • 1. Retention period – while it’s not too late
  • 2. Restore simply Disconnected mailboxes
  • a. How is a mailbox disconnected?
  • Using ECP
  • Using the Shell is even simpler:
  • b. Recover the disconnected mailbox
  • Using ECP
  • Using the Shell:
  • 3. Accidentally deleted Mailboxes
  • Recover with ADAM:
  • Recovery when AD Recycle Bin is not enabled

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}