Reconnecting Disconnected Exchange Mailboxes

When an Exchange user is either Disabled or Deleted, the mailbox is placed in a disconnected state on the Database. The disconnected mailbox will remain available according to the database settings. To view how long a MB will stay in a disconnected state, you can check the DB properties. For Exchange 2013/2016 log in to the EAC and browse to servers and then Databases. From there select the database in question and choose Edit. Under Limits, you will see the number of Days to keep a Deleted Mailbox. The default setting is 30 days.

In Exchange 2010 the process is similar. Open the EMC, expand Organization Configuration, and select Mailbox. In the Database Management tab, select a database, right click and choose properties. Under the Limits tab you will see the deleted mailbox setting.

The Deletion settings are configured per database, so it’s a good idea to check all DBs to ensure they are configured with the desired settings.

Now that we know how long the disconnected mailbox will stick around. Lets look at how we can reconnect the mailbox to a user account. First, it’s good to know if the original user was Disabled or Removed/Deleted. If the account was just disabled, then the AD user account should still exist and we can just reconnect the disabled mailbox to the original account. If the account was Removed/Deleted, then we first have to recreate the AD account. Then we can reconnect the mailbox.

Reconnecting a mailbox is pretty strait forward using the EMS. The first step will be to locate the disconnected mailbox. To search for disconnected mailboxes across all databases, run the command.
[PS] C:\Windows\system32>Get-MailboxDatabase | Get-MailboxStatistics | Where-Object { $_.DisconnectDate -ne $null } | FL DisplayName,Database -auto

The command we just ran provides us with required info to continue. We can now connect a disconnected mailbox to an AD account by running the command.
[PS] C:\Windows\system32>Connect-Mailbox -Identity "Nathan Stark" -Database MDB13-2 -User
If the user account is removed/disabled and you need to reconnect the mailbox shortly after it was disconnected, the mailbox may not show up as disconnected when running the above command. You can wait for the nightly database maintenance to complete, or you can run the cleanup process on your own.
[PS] C:\Windows\system32>Get-MailboxDatabase | Clean-MailboxDatabase

Once the command completes, the disconnected mailbox should be listed and available to reconnect.

There is also the possibility of an account being recreated with a new mailbox. In this situation, you can’t just reconnect the disconnected mailbox. You will have to “restore” the data from the disconnected mailbox to the newly created mailbox.
[PS] C:\Windows\system32>New-MailboxRestoreRequest -SourceDatabase "MDB16-1" -SourceMailbox "Holly Martin" -DestinationMailbox "" -AllowLegacyDNMissmatch

Once the restore has started, you can view the job status using the command.
[PS] C:\Windows\system32>Get-MailboxRestoreRequest

Finally, you should note that with Windows Server 2008 R2 Active Directory Recycle bin was introduced. If this feature is enabled, it provides administrators with the ability to quickly restore any deleted users to the state they were in before deletion. If the deleted user had a mailbox attached, when they are restored the mailbox is automatically reconnected as well with nothing needing to be performed on the Exchange side of things.