Attaching an EX2010 mailbox and “Mailbox Disabled”

A small curiosity…

An AD user account was accidentally deleted. After quickly restoring or creating a new account in AD and recovering the files, in theory all that remains is to attach the mailbox to the new account.

In theory… because when the user tries to log in through OWA, they get this message:

Mailbox disabled, Exception type: Microsoft.Exchange.Data.Storage.AccountDisabledException

You still need to clean up and synchronize AD with the MS Exchange Store:

get-mailboxdatabase | Clean-MailboxDatabase