Restoring a Disconnected Mailbox

 in Exchange

I came across an issue at a client where for reasons as yet unknown about 15 users across various servers/databases in a single DAG suddenly had their mailboxes disconnected and a new one created. Now the mailboxes had different GUIDs of course, but they had the same LegacyExchangeDN and the users were now connected to the newer (and pretty much empty) mailbox.

After working out that a new mailbox had indeed been created for those users we starting thinking about how to get the data merged together. At first we looked at options of PST export/import and using search-mailbox, however both of those require the mailbox to be connected. Now that looked like it might be simple enough, reconnect the mailbox and grab the data to place it into their new mailbox and all is sorted…

Problem… Connecting a disconnected mailbox when you have an active mailbox that has the same LegacyExchangeDN isn’t possible… So, what to do now…? We thought about amending the user’s live AD object, changing the LEDN, etc. but that just seemed far too complicated. After some googling, we found a surprisingly simple answer… New-MailboxRestoreRequest to the rescue.

Now although intuitively it might seem like New-MailboxRestoreRequest is only for taking data from the Recovery Storage Group, it works for any mailbox. One small issue was how to address the source mailbox, since it had the same DisplayName and LegacyEschangeDN, but fortunately we can use a GUID.

New-MailboxRestoreRequest -SourceDatabase DB1 -SourceStoreMailbox "{GUID}" -TargetMailbox 'User Display Name'

wait for the MRS to finish the job and voila, problem solved.

Now in our case the LegacyExchangeDN remained the same, so we had no issues with restoring, if you do need to restore into a mailbox that has a different LegacyExchangeDN from the source mailbox, have no fear… New-MailboxRestoreRequests has a parameter called AllowLegacyDNMismatch!

So a short post today, but hopefully a useful and time saving one. Until next time

Twan van Beers

Twan is a senior consultant with over 20 years of experience. He has a wide range of skills including Messaging, Active Directory, SQL, Networking and Firewalls. Twan loves to write scripts and get deep and dirty into debugging code, in order to understand and resolve the most complex of problems.

Leave a Reply

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

Search