Solved

Remove all soft deleted mailboxes Exchange 2010 SP1

Posted on 2013-06-05
2
1,618 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
ID: 39223556
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
ID: 39226600
Perfect thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
how to add IIS SMTP to handle application/Scanner relays into office 365.

776 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