Delete a disconnected mailbox from exchange 2010

As you probably already know in Exchange 2010 the Purge option disappeared and there is actually almost no easy way to remove a disconnected mailbox from the exchange 2010 server. When you removed an users the disconnected mailbox will disappear hidden. The get is back non hidden you have to use an easy command in the Exchange Management Shell

clean-mailboxdatabase "Mailbox Database 1166050598"

However you should get all information about the mailbox of the deleted user and disconnected mailbox. To get this information you should use the Exchange Management Shell. You can use the following command..

Get-MailboxStatistics -Database "Mailbox Database 1166050598" | Where-Object {$_.DisconnectDate -Notlike $NULL} | FL DisplayName, DisconnectDate, MailboxGuid

Result

DisplayName    : USERMAN
DisconnectDate : 1-7-2010 16:00:48
MailboxGuid    : def4aabd-2156-5857-858f-470efc3e6f28

Thake the MailboxGuid and copy it to Notepad. For easy modification.
This MailboxGuid is needed to remove the mailbox completely.

Remove-Mailbox -Database "Mailbox Database 1166050598" -StoreMailboxIdentity def4aabd-2156-5857-858f-470efc3e6f28

After this command the mailbox is defiantly gone from your Exchange server.

[ exchange management console
> Microsoft Exchange On-Premises
> Recipient Configuration
> Disconnected Mailbox ]

with more disconnect mailboxes you could write a batch file for removing.
UPDATE: There is a way to delete all the disconnected mailboxes via [ www.petenetlive.com ] I used the followin commands to delete a bounce of mailboxes at once.
First run the command in the administrative exchance console.

$mailboxes = Get-ExchangeServer | Where-Object {$_.IsMailboxServer –eq $true} | ForEach-Object { Get-MailboxStatistics –Server $_.Name | Where-Object {$_.DisconnectDate –notlike ‘’}} | select displayname, mailboxguid, database

After this command you have to use the following command line.

$mailboxes | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

If you have done this you can check in the exchange console if the disconnected mailboxes are gone.
Update2 extra option to use:
If you use the following command. users will be deleted for sure.

Get-MailboxStatistics -Database "<database>" -OutBuffer 1000 | ? {$_.DisconnectReason -eq "SoftDeleted"} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

Attention: I reconized some issues with command’s to solve this issue copy past the command into notepad and check if there are no ? where ” needed. Most of the time it’s on the end of a command. The command’s shown above are correct. Only HTML > powershell is not optimal sometimes.

26 thoughts on “Delete a disconnected mailbox from exchange 2010”

  1. Thanks for this! Followed your instructions and I finally managed to purge disconnected mailboxes from the Management Console. Unfortunately, that made no impact on the data size overall (which is why I was trying to achieve this in the first place). I know this is slightly off topic but any indication why this has happened?

    1. It’s because The Database of Exchange 2010 will fill up the empty space with the new data. You can run the old fashion way eseutil but you can also run the 24/7 defragmentation in Exchange. To get the free space you need to use eseutil. Up to 500GB it’s worth to use eseutil after 500GB not anymore. ( I’ve read this in some microsoft documentation. Can’t remember where I found it. )

        1. Indeed that will lead to an outrage of the network / exchange / mail traffic for a couple of hours. ( an other option is to create a new Database and move all the mailboxes to that database )

  2. Both are scary prospects, since the Exchange DB size is currently at 800GB +.
    If I have 24/7 maintenance running, will that reclaim that “white space”?

    1. you are right about that. It could be scary.. 24/7 maintenance will keep on track about the white space and free more white space when mail or mailboxes are deleted. How ever it won’t reclaim disk space like ESEUTIL does.

  3. Brian E. Conklin

    Another thing to note about ESEUTIL, you need at least as much free drive space as the size of your current database to defrag into.

  4. Pingback: Delete disconnected mailbox +exchange 2010 « Raydha's Blog

  5. Pingback: Delete a disconnected mailbox from Exchange 2010 | V3ct0r's Tech Knowledge base

  6. And Microsoft actually does not recommend running ESEUTIL on Exchange 2010 databases. The preferred method is to move mailboxes to a new database and delete the old database. This does, unfortunately, mean you need lots of free disk space until you get all of the mailboxes moved.

  7. Please advice- We have 2 TB of data to be purged from a mailbox, will it release the white space.
    We need recreate new db and move the users then delete the old content

    1. If you can’t have downtime on you mailbox store you have do this. If you’re able to have downtime on your mailbox store you can use the old fashion “eseutil” command to decrease the mailbox store.

  8. when I try and use this, at 1st command I get an error:
    WARNING: The database ‘AAFXCH1\Recovery Storage Group\Mailbox Database’ to be
    accessed on server ‘aafxch1.xxxxxxx.com is not mounted or is
    not available.

    1. I think this is not prossible to do from a recovery storage group. I have never tried it from the recovery storage group.
      If you try to select an other database do you get the same warning?

Leave a Reply

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