Thursday, March 24, 2016

Removing Mysterious Mailboxes

Hi folks,

Let me write you about my recent experience. I was decommissioning one of the default databases on my Exchange 2013 server. After moving all the arbitration and monitoring mailboxes from it and confirming that nothing is there I attempted to delete it. However I was faced with the error like this one:

I followed the advice of the article by searching all kind of possible mailboxes (including the normal ones), yet without success. Trying to identify what is that mailbox that was holding the removal by following this blog post didn't help me either.

So I had to look for the solution of this question and here AD Users and computers came to my help. According to the instructions in this article I have created custom search based on the value in homeMDB attribute (this attribute contains DN of the mailbox database I was trying to remove from my org).

So I got something like this;

(homeMDB=CN=Mailbox Database 1234567890,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=CONTOSO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=com)

I used this in the step of the following workflow:
1. Launch ADUC (or dsa,msc)
2. Right-click the domain object and select Find.
3. Click the drop-down list next to Find, and then select Custom Search.
4. From the next screen, select the Advanced tab.
5. Type the filter I have put together
6. Select Entire forest in the In section
7. Click Find now

As the result I was able to find one mailbox which had this DB as its homeMDB attribute.

I have run the following command:

Get-Mailbox | select database

This resulted in DB that was causing me headache.

I have moved it by launching the following command:

Get-Mailbox |New-MoveRequest -TargetDatabase DB001

As soon as mailbox has been moved to the new DB, I had run the same query again which returned me an empty list. And I removed the problematic DB by using good old command

Remove-MailboxDatabase "Mailbox Database 1234567890" -confirm:$false

After this I have killed all the associated with it files.