Unable to Delete Exchange 2016 Database


Edit: Microsoft has released the below KB to acknowledge this issue:

https://support.microsoft.com/en-us/kb/3093175

Edit#2: I’ve been told that this should be remedied in a future Exchange 2016 CU by having the error dialog include the -AuditLog parameter.

Symptom

After installing Exchange 2016 you may wish to delete the default Mailbox Database that is installed. Or during regular operations, you decide to remove any 2016 Mailbox Database in the environment. Of course before you do this you’ll need to move all mailboxes from the soon to be deleted database to another Mailbox Database. You could then run the following command to verify no mailboxes still exist on the database:

Get-Mailbox –Database MailboxDatabase

This should return no results

F1

However, when attempting to remove the database you receive the below message:

This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database <Database ID>. To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID>. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest <parameters>. If this is the last server in the organization, run the command Disable-Mailbox <Mailbox ID> -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration

F2

A common issue in Exchange 2010 and 2013 was being unfamiliar with how to view hidden Arbitration mailboxes, which are used for various system functions, and could prevent a database from being removed. To view these mailboxes you could run the following command:

Get-Mailbox –Database MailboxDatabase –Arbitration

This should return the Arbitration mailboxes installed on the first Mailbox Database in the Exchange environment. When performing a migration from a previous version of Exchange, these mailboxes should be moved to the newest version of Exchange.

F3

However, even after these mailboxes have been vacated from this database, the original error is still displayed. In Exchange 2016 RTM, the Get-Mailbox parameters which the error dialog box presents for you to try are:

  • -Archive
  • -Arbitration
  • -PublicFolder

Unfortunately, these may still display no results. There is one additional parameter, which is new to Exchange 2016, you will likely need to use:

Get-Mailbox –Database MailboxDatabase –AuditLog

This should display a system mailbox new to Exchange 2016.

F4

Once this mailbox is moved, you should be able to successfully delete the Mailbox Database.

This –AuditLog parameter seems effectively undocumented, as the TechNet Article for the Get-Mailbox command states it is reserved for internal Microsoft use. Unfortunately, we found that is not entirely the case.

 

 

Advertisements

Problem after removing arbitration mailbox using ADSIEdit


If you removed the arbitration mailbox from ADSI and not via EMS (Here’s how to use EMS) you may get the following errors when trying to reinstall the mailbox role.

Log Name: Application
Source: MSExchangeSetup
Event ID: 1002
Task Category: Microsoft Exchange Setup
Level: Error
Keywords: Classic
User: N/A

Exchange Server component Mailbox Role failed.
Error: Error:
The following error was generated when "$error.Clear();
if ($RoleIsDatacenter -ne $true)
{if (test-ExchangeServersWriteAccess -DomainController $RoleDomainController -ErrorAction SilentlyContinue)
{# upgrade the discovery mailboxes to R5 version, this will fix the RecipientDisplayType property of the discovery mailbox which was wrong in R4.
get-mailbox -RecipientTypeDetails DiscoveryMailbox -DomainController $RoleDomainController | where {$_.IsValid -eq $false} | set-mailbox -DomainController $RoleDomainController
$name = [Microsoft.Exchange.Management.RecipientTasks.EnableMailbox]::DiscoveryMailboxUniqueName;
$dispname = [Microsoft.Exchange.Management.RecipientTasks.EnableMailbox]::DiscoveryMailboxDisplayName;
$mbxs = @( get-mailbox -Filter {name -eq $name} -IgnoreDefaultScope -resultSize 1 );
if ( $mbxs.length -eq 0)
{$dbs = @(get-MailboxDatabase -Server:$RoleFqdnOrName -DomainController $RoleDomainController);
if($dbs.Length -ne 0)
{$mbxUser = @(get-user -Filter {name -eq $name} -IgnoreDefaultScope -ResultSize 1);
if ($mbxUser.Length -ne 0)
{enable-mailbox -Discovery -identity $mbxUser[0] -DisplayName $dispname -database $dbs[0].Identity;}}}}
else
{write-exchangesetuplog -info "Skipping creating Discovery Search Mailbox because of insufficient permission."} }

Active Directory operation failed on server.domain.local. This error is not retriable. Additional information: The name reference is invalid.
This may be caused by replication latency between Active Directory domain controllers.
Active directory response: 000020B5: AtrErr: DSID-03152392, #1:0: 000020B5: DSID-03152392, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 200f4 (homeMDB)

Normally this error indicates a problem contacting a DC or the Server not being in the “exchange servers” AD group, in this specific instance this can be caused because the discovery mailbox missing the HomeMDB and HomeMTA attributes.

Here is how to manually add them back

  1. Start –> Run –> ADSIEDIT.MSC (should already know this since you used it to remove the MBX)
  2. Default Naming Context –> “DC=Domain, DC=Local” –> CN=Users –> CN=DiscoverySearchMailbox {}
  3. image
  4. Right Click –> Properties
  5. Find HomeMDB and HomeMTA this needs to be populated with the DN of the server and Database.image

Also to recreate the arbitration mailbox use new-mailbox commandlet with the –arbitration parameter