locked
How to get Exchange to immediately purge multiple mailboxes? RRS feed

  • Question

  • I deleted a bunch of AD users.  I then ran the cleaup agent.  I see a bunch of X's beside the deleted users mailboxes.

    I can only purge mailbox on a one-by-one basis, NOT multiple.  If I choose multiple mailboxes using the CTRL key, there is NO purge option.

    I set the "keep deleted mailbox for" to 0 days. 

    Is there anyway to force that option to run right away to purge mailboxes instead of waiting 24 hours?

    Tuesday, February 7, 2012 2:55 PM

Answers

  • Hi there,

    this command will do the trick for you..

    Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    • Proposed as answer by Sophia Xu Thursday, February 9, 2012 2:03 AM
    • Marked as answer by Sophia Xu Tuesday, February 28, 2012 9:08 AM
    Tuesday, February 7, 2012 3:48 PM
  • On Tue, 7 Feb 2012 16:04:28 +0000, ccslai wrote:
     
    >>this command will do the trick for you..
    >>
    >>Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}
    >>
    >>
    >>Kottees : My Blog : Please mark it as an answer if it really helps you.
     
    >sorry but is that using cscript to run it?
     
    No. Powershell. If you're running Exchange 2003 the script is of no
    use to you.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by Sophia Xu Tuesday, February 28, 2012 9:08 AM
    Wednesday, February 8, 2012 4:01 AM

All replies

  • Hi there,

    this command will do the trick for you..

    Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    • Proposed as answer by Sophia Xu Thursday, February 9, 2012 2:03 AM
    • Marked as answer by Sophia Xu Tuesday, February 28, 2012 9:08 AM
    Tuesday, February 7, 2012 3:48 PM
  • Hi there,

    this command will do the trick for you..

    Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    sorry but is that using cscript to run it?
    Tuesday, February 7, 2012 4:04 PM
  • On Tue, 7 Feb 2012 16:04:28 +0000, ccslai wrote:
     
    >>this command will do the trick for you..
    >>
    >>Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}
    >>
    >>
    >>Kottees : My Blog : Please mark it as an answer if it really helps you.
     
    >sorry but is that using cscript to run it?
     
    No. Powershell. If you're running Exchange 2003 the script is of no
    use to you.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by Sophia Xu Tuesday, February 28, 2012 9:08 AM
    Wednesday, February 8, 2012 4:01 AM