Monday, November 23, 2020

Remove a disconnected Mailbox from Exchange 2010

This is a quick how to which will enable you to remove any disconnected mailboxes from exchange 2010, since the purge mailbox feature is no longer available. (Source: spiceworks).

Step 1: Run a clean on your mailbox store

Perform the below command in order to run the Clean task on your exchange mailbox store, you need to do this via the Exchange Command Powershell

clean-mailboxdatabase [Mailbox Store Name]

Step 2: Get a list of disconnected mailboxes in your database

Then run the below command to get a list of mailboxes that are in a disconnected state

Get-MailboxStatistics –Database [Mailbox Store Name] | Where-Object {$_.DisconnectDate -Notlike $NULL} | FL DisplayName, DisconnectDate, MailboxGuid

Step 3: Results

You should now see a result similar to the below

DisplayName    : USERNAME
DisconnectDate : 29/10/2018 1:15:03
MailboxGuid    : 7bb4935d-0ba5-4b5a-b6d0-a3f2f2e4d17f

Step 4: Gather maxboxguid

Take the MailboxGuid and copy it to Notepad. For easy modification.

The MailboxGuid is needed to remove the mailbox completely, use the below command to remove the mailbox

Step 5: Remove / Delete the mailbox/'s

Now run the below comand inserting the Mailboxguid that you want to remove, repeat the process if you have multiple mailboxes to remove

Remove-Mailbox –Database [Mailbox Store Name] -StoreMailboxIdentity 7bb4935d-0ba5-4b5a-b6d0-a3f2f2e4d17f

you will now be prompted to confirm that you want to completely remove the mailbox, if you agree accept this prompt.

You can the re run the Get-MailboxStatistics above to check there are no disconnected mailboxes remaining.

Step 6: Verify

to verify the mailboxes are no longer there , re -run the command in step 2, hopefully this will now display zero results.

Job Done !

No comments:

Post a Comment