Force remove a disconnected mailbox on Exchange 2010

You can check what mailboxes are disconnected using EMC by going to Recipient Configuration –> Disconnected Mailbox

But you cannot delete a disconnected mailbox using EMC (But database maintenance task will remove them after the set period of time, by default after 30 days)

You can see which mailboxes are either removed or disabled on the server by running the following command in Exchange Management Shell:
Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -ne $null} | ft displayname,database,disconnectreason -auto

If you wanna force the deletion of a mailbox, please use the following command:
Remove-StoreMailbox -Database <Database Name> -Identity <Display Name> -MailboxState SoftDeleted
if the mailbox is Disabled:
Remove-StoreMailbox -Database <Database Name> -Identity <Display Name> -MailboxState Disabled
You will have to use the display name for Identity parameter as nothing else will work.

If you want to do this to all disabled/removed mailboxes for a given database, try this:
Get-MailboxStatistics -Database <database name> | where {$_.DisconnectReason -eq “Disabled”} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.displayname -MailboxState Disabled}
You can change DisconnectReason and MailboxState to “SoftDeleted” if the mailbox was removed instead of disabled.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.