locked
Remove moved mailboxes from source database RRS feed

  • Question

  • Hello,

    I have moved several mailboxes from one database to another 2010 database. But for some reason the database size remains the same. Any suggestions on clearing out the mailbox database of disconnected mailboxes?

    Thanks.

    Ross

    Wednesday, March 16, 2011 9:08 AM

Answers

  • Hi,

     

    When mailboxes are moved from an Exchange 2010 SP1 database to any other database, Exchange doesn't fully delete the mailbox from the source database immediately upon completion of the move. Instead, the mailbox in the source mailbox database is switched to a soft-deleted state. Mailbox data can be accessed during a mailbox restore operation using the MailboxRestoreRequest cmdlet set. The soft-deleted mailboxes are retained in the source database until either the deleted mailbox retention period expires or you use the Remove-StoreMailbox cmdlet to purge the mailbox

    More information about understanding move requests

    http://technet.microsoft.com/en-au/library/dd298174.aspx#SoftDel

    This example purges the soft-deleted mailbox for Jane from mailbox database MBD01.

    Remove-StoreMailbox -Database MBD01 -Identity Jane -MailboxState SoftDeleted

    For more information about Remove-StoreMailbox

    http://technet.microsoft.com/en-au/library/ff829913.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by emma.yoyo Monday, March 28, 2011 10:11 AM
    Thursday, March 17, 2011 9:10 AM

All replies

  • The physical database size not gained by moving or deleting the mailboxes. only white space is created. To get the physical database size, offline defragmentation must be performed.
    Wednesday, March 16, 2011 2:33 PM
  • Agree with Rajith, Moving mailbox from database does not compact DB size. you can use ESEUTIL /d for offline defragmentaion.

    Offline defragmentaion is not a suitable solution for reduce DB size as its required good amount of down time (Depend upon DB size). For this you can move all maibox in other store and delete DB then create new DB and move mailbox back in new DB.

    Hope you are well aware now.


    Anil
    Wednesday, March 16, 2011 5:28 PM
  • Hi,

     

    When mailboxes are moved from an Exchange 2010 SP1 database to any other database, Exchange doesn't fully delete the mailbox from the source database immediately upon completion of the move. Instead, the mailbox in the source mailbox database is switched to a soft-deleted state. Mailbox data can be accessed during a mailbox restore operation using the MailboxRestoreRequest cmdlet set. The soft-deleted mailboxes are retained in the source database until either the deleted mailbox retention period expires or you use the Remove-StoreMailbox cmdlet to purge the mailbox

    More information about understanding move requests

    http://technet.microsoft.com/en-au/library/dd298174.aspx#SoftDel

    This example purges the soft-deleted mailbox for Jane from mailbox database MBD01.

    Remove-StoreMailbox -Database MBD01 -Identity Jane -MailboxState SoftDeleted

    For more information about Remove-StoreMailbox

    http://technet.microsoft.com/en-au/library/ff829913.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by emma.yoyo Monday, March 28, 2011 10:11 AM
    Thursday, March 17, 2011 9:10 AM
  • Thanks for the info about the defrag I will do this on the next scheduled down time. I would simply let that database die but I don't have a great amount of space left on the data drive.

    I did purge the soft deleted users from the database but like stated above its white space.

    Thanks for your advice.

    Ross

    Thursday, March 17, 2011 9:17 AM
  • I ran Powershell command listed in http://64.4.11.252/en-us/library/gg181092.aspx and I got an error:

    Get-MailboxStatistics -Database MBXDB01 | where {$_.DisconnectReason -eq "SoftDeleted"} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

    Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.
        + CategoryInfo          : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [],
       PSInvalidOperationException
        + FullyQualifiedErrorId : RemotePipelineExecutionFailed

    I need to delete all soft delete disconnected mailboxes, not just one. Thanks.

    Thursday, April 21, 2011 1:45 PM
  • I have same error .. any luck on a syntax change to fix this ?
    Steve Lithgow
    Wednesday, November 9, 2011 5:14 PM
  • You could do it like this:

    $mbs = Get-MailboxStatistics -Database MBXDB01 | where {$_.DisconnectReason -eq "SoftDeleted"}
    foreach($mb in $mbs)
    {
    Remove-StoreMailbox -Database $mb.database -Identity $mb.mailboxguid -MailboxState SoftDeleted -Confirm:$false
    }


    Kind regards,

    Nico Martens - MCTS, MCITP
    SharePoint 2010 Infrastructure Consultant
    Blog: SharePoint Related
    E-mail: Nico Martens
    Thursday, February 2, 2012 12:59 PM