Exchange 2010 – Delete / Remove all Disconnected Mailboxes

KB ID 0000470 Dtd 24/06/11

Problem

In older versions of Exchange, we just had to “Purge” disconnected mailboxes, now we don’t have that option.

Solution

WARNING this will remove ALL disconnected mailboxes, make sure you actually want to do this before proceeding.

1. On one of the Exchange servers > Start > All Programs > Microsoft Exchange Server 2010 > Exchange Management Shell.

2. Issue the following commands;

$mailboxes = Get-ExchangeServer | Where-Object {$_.IsMailboxServer –eq $true} | ForEach-Object { Get-MailboxStatistics –Server $_.Name | Where-Object {$_.DisconnectDate –notlike ‘’}} | select displayname, mailboxguid, database

Then;

$mailboxes | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

Purge Mailboxes

2. If you have the Exchange Management console open (as above), you may need to refresh, before they disappear.

Related Articles, References, Credits, or External Links

NA

Author: Migrated

Share This Post On