[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Remove all soft deleted mailboxes Exchange 2010 SP1

Posted on 2013-06-05
2
Medium Priority
?
2,004 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Bruno PACI earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
In this video we show how to create an Address List 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 Organization >> Ad…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses

650 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