Fail to Clean up the Source Mailbox After the Mailbox Move

Problem description:
=================
Fail to clean up the source mailbox after the mailbox move (Exchange 2010). I was running out of hard drive space on the virtual Hard drives that contained the Exchange databases. The easy solution would be to increase the size which I end up doing any ways. But I found this issue, It so happens that after I moved the mailboxes to a different database from the Exchange Management control neither the Available New Mailbox Space was increasing nor was I recuperating the hard drive space lost. The message I was receiving after the transfer was “ Warning: Failed to clean up the source mailbox after the move. Error details : Mapi Exception Unexpected Mailbox State: Unable to delete mailbox” In investigating the issue, I found out that I had more studs lingering from previous moves.

Solution
========================

  1. Clean stub mailbox manually

$aa=Get-MailboxStatistics -Database DB1| where {$_.DisconnectReason -eq “SoftDeleted”}

$aa | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

 1.	Clean stub mailbox manually

In General, In my troubleshooting with MS they explained that when the stub mailboxes are manually or automatically removed, the available new mailbox space is available for new data to be written without growing the size of the edb file, But the edb file will not shrink and that only after completing the White Space it will increase the edb file size requiring of course more space from the hard drive.

So, If you want to reclaim the space, there are two ways:

  • Create a new mailbox database and move all the mailboxes to that database ( time consuming )
  • Perform an offline defrag of the existing database to shrink the file (downtime)

In addition I was advised to install the Rollups which I already had to all of my exchange servers in the following order:

  1. Client Access server
  2. Hub Transport server
  3. Unified Messaging server
  4. Mailbox server

  Helpful Commands:
==================  
To get users mailbox list in an Exchange Database.
[PS] > Get-MailboxDatabase “DB1″ | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount

To view the available white space of the exchange databases.
[PS] >Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace

To view SoftDeleted mailboxes
[PS] >Get-MailboxStatistics -Database DB1| Where { $_.DisconnectReason -eq “SoftDeleted” } | Format-List LegacyDN, DisplayName, MailboxGUID,DisconnectReason

Selecting the softDeleted mailbox using the MailboxGUID and remove the selected SoftDeleted mailbox
[PS] >$mb= Get-MailboxStatistics -Database DB1 | where {$_.MailboxGuid -like “########-####-####-####-############”}
[PS] >Remove-StoreMailbox -Database $mb.database -Identity $mb.mailboxguid -MailboxState softDeleted

Selecting all the soft deleted mailboxes
[PS] >$mbs= Get-MailboxStatistics -Database DB1 | where {$_.DisconnectReason -eq “SoftDeleted”}
[PS] >$mbs| foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

More information:
===============
Exchange, Stubbing, and Database Space Reclamation
http://blogs.technet.com/b/exchange/archive/2012/08/27/exchange-stubbing-and-database-space-reclamation.aspx

Hopefully this will help someone else.

Original Article:

http://ninoch.wordpress.com/2013/02/01/fail-to-clean-up-the-source-mailbox-after-the-mailbox-move/
 Short Link: http://wp.me/p2ccJ8-3K


Nino Chavez

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s