Deleting the Wrong Mailbox in Exchange Server 2007 – And Restoring It

Tech Supporton April 30th, 201013 Comments

So, it was bound to happen… We removed the wrong user’s mailbox in Exchange Server 2007 today.  Unfortunately, with Server 2007, removing an account, removes the Windows user object and also marks the mailbox in the database for removal.  Luckily, there is a relatively quick fix:

  1. Restore the Active Directory object with the AdRestore utility
  2. Connect the disconnected mailbox to the restored user account

Step 1
First, we downloaded the AdRestore program from Microsoft onto our primary Active Directory server and then ran the command:

> adrestore -r username

The program searches through recently deleted (tombstoned) objects and allows you to recover them.  The username part works as a rudimentary search.  If it finds the object, it prompts you to proceed.  Once you do, the account is restored.  It’s disabled and doesn’t have a password, so you’ll need to set the password and the activate the account. Microsoft has a long drawn-out article on restoring Active Directory accounts, but running this simple tool seemed to work fine for us.

Step 2
In the Exchange Management Console, we went to Recipient Configuration -> Disconnected Mailbox and went to find the deleted mailbox.  Oh crap! It wasn’t there!  Luckily, it turns out that if the mailbox management process has not yet run, you will not see recently deleted mailboxes.  Fortunately, you can force this by going to the Exchange Management Shell and running:

> clean-mailboxdatabase “Mailbox Database

After running this command, the disconnected mailbox now appeared.  You then right-click on it, and select “Connect…”  Check “User Mailbox” and click Next.  Then, select “Existing User,” browse to find the user, make sure their Alias is correct, and click Next. Clicking Finish reconnects the user’s old mailbox to the restored user account.

The reconnection looked like it finished quickly, but we found that it took about an hour for it to fully connect and allow the user access to her email again.  Hope this helped!

13 Responses to “Deleting the Wrong Mailbox in Exchange Server 2007 – And Restoring It”

  1. Joe says:

    Extremely helpful tool and excellent tutorial. Running ADRestore -r seemed to have restored the object, although I'm not able to find it in ADUC.

  2. Eddie says:

    Great article, I had to restore 3 users that were deleted by accident and this totally helped.

  3. anewton says:

    Great Great article, thank. Got me out of a very sticky spot

  4. @scottbutler5 says:

    Thank you so much for this! I was going nuts because the mailbox wasn't listed under Disconnected Mailbox, none of the other sites I read said anything about running clean-mailboxdatabase.

  5. juref says:

    I can't express how grateful I am for this – I've been going nuts because a deleted mailbox wasn't appearing in the 'Disconnected Mailboxes' list, thank you for the "clean-mailboxdatabase “Mailbox Database“" command!

  6. Joe says:

    I have the retension set to 30 days, but my deleted mailbox will not show up in the disconnected mailbox container. Yes, I attached to the correct server (the only exchange in the org) and yes, I ran the clean command. Any ideas? Or am I going to have to restore from backup.

  7. Smood says:

    Great article, just saved my ass. Thanks 🙂

  8. LeSmu says:

    Great article! Thanks for that!

  9. Akinseak says:

    It also seems to restore the deleted account successfully here, but i wonder where it end up..
    I cant find the acccount anywhere in my AD..
    Not even a search for it helps.. any suggestions ?

    Gman

  10. Harry says:

    Thank you very much. These instructions were nice and simple to follow and did the trick.

  11. patters says:

    Thanks for this. I had a helpdesk staff member accidentally delete a mailbox after renaming its Display Name by accident, which he then thought was a new account he'd created my mistake. I had configured the helpdesk users group to be Exchange Recipient Administrators so although he didn't have permission to remove the mailbox (he got an error dialog), his Active Directory Account Operator rights did mean the account object was deleted.

  12. patters says:

    After reading this page, I used the adrestore.exe command and brought the AD account back. Then I had some trouble running CleanMailboxDatabase because, although they all have unique StorageGroup names, my mailbox databases all seem to have the name "Mailbox Database". I got around this by using:
    Clean-MailboxDatabase -Identity "MYSERVER\Resource Mailboxes\Mailbox Database"

    I couldn't understand why I couldn't find the deleted mailbox in Disconnected Mailboxes, but it then turned out that it simply reattached once the account came back, but with the accidentally renamed Display Name (which I had forgotten about so I was looking for the wrong name in the Recipients part of the snap-in). This was because the helpdesk user didn't in fact have the permission to disconnect or remove it.

    Until now I had never needed to restore an AD object so I wasn't even aware of adrestore.exe – thanks again!

Leave a Reply