Solved

Remove all soft deleted mailboxes Exchange 2010 SP1

Posted on 2013-06-05
2
1,519 Views
Last Modified: 2013-06-06
So I found this command on technet.

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

Open in new window


It sort of works in that it will remove some of the soft deleted boxes, but I have to run it severl times, and then it will usually leave me with a dozen or so to manually remove. I'm splitting a DB, and every move leaves a dc'd maiblox. This is the error I get.

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

Open in new window

0
Comment
Question by:bhieb
2 Comments
 
LVL 16

Accepted Solution

by:
PaciB earned 500 total points
Comment Utility
Hi,


Try by writing a .ps1 script file with these lines:

$MBList = Get-MailboxStatistics -Database Mailbox2 | where {$_.DisconnectReason -eq "SoftDeleted"}

$MBList | ForEach {
    $MB = $_
    Remove-StoreMailbox -Database $MB.database -Identity $MB.mailboxguid -MailboxState SoftDeleted -confirm:$false
}

Open in new window



Have a good day.
0
 

Author Comment

by:bhieb
Comment Utility
Perfect thanks!
0

Featured Post

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video discusses moving either the default database or any database to a new volume.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now