Remove-MailboxDatabase fails

I am migrating from one Exchange 2013 server to another.  I am at the point where everything is running on the new server, and I am trying to uninstall Exchange.  It's failing to remove the mailbox database, insisting that mailboxes are in it that I have confirmed are not.  The following commands produce no results:

Get-Mailbox -Database "Mailbox Database 1096099116"
Get-Mailbox -Database "Mailbox Database 1096099116" -Archive
Get-Mailbox -Database "Mailbox Database 1096099116" -Arbitration
Get-Mailbox -Database "Mailbox Database 1096099116" -PublicFolder
Get-Mailbox -Database "Mailbox Database 1096099116" -Monitoring

However, attempting Remove-MailboxDatabase -Identity "Mailbox Database 1096099116" -Verbose produces the following error:

VERBOSE: [16:02:40.757 GMT] Remove-MailboxDatabase : Mailbox with DistinguishedName <<omitted>> is still present in this database.

And yet, when I look at the user's mailbox, there is no reference at all to the old database.  It currently resides on the new database.  Moving it to the old database and back again didn't fix it.  Originally, this was the domain administrator account in the error.  We don't really use it for anything but checking mail flow, so I disabled the mailbox and tried again.  Now it is throwing the same error on a different user's mailbox which I cannot delete.

I've verified replication among my DCs and also tried specifying a different one in some of the commands, and nothing changed.  I'm at a loss as to where to go from here.  I can't find anything still present in that database, but it insists there are still mailboxes in it and will not let me remove it or uninstall Exchange.

March 13th, 2015 12:50pm

Hello

cheek disconnected mailbox

Get-MailboxStatistics -Database db_name | ForEach {Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$False}

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisconnectReason -ne $null } | fl DisplayName,MailboxGuid,Database,DisconnectReason

and if have disconnected mailbox remove with Remove-StoreMailbox

Free Windows Admin Tool Kit Click here and download it now
March 13th, 2015 2:31pm

On the first command, I get this error repeatedly.  I tried it twice.
Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.

I have noticed something that may be my problem.  On the user object mentioned in the error:

ArchiveDatabase                        :
ArchiveGuid                            : 00000000-0000-0000-0000-000000000000
ArchiveName                            : {}
JournalArchiveAddress                  :
ArchiveQuota                           : Unlimited
ArchiveWarningQuota                    : Unlimited
ArchiveDomain                          :
ArchiveStatus                          : None
ArchiveState                           : None
DisabledArchiveDatabase                :
DisabledArchiveGuid                    : 00000000-0000-0000-0000-000000000000
ArchiveRelease                         :


However, looking at the attributes on the AD user object, I see this:

Attribute:
msExchArchiveDatabaseLink

Value:
CN=Mailbox Database 1096099116,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Exchange,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=local

Clearly referencing the old database.  On the admin user where I deleted and recreated the mailbox, this attribute is not set.  There are no archive mailboxes at all according to Exchange, so is it safe for me to modify or unset this attribute?

Thanks

March 13th, 2015 2:52pm

Hello

tip: http://goo.gl/HnpCeX

Free Windows Admin Tool Kit Click here and download it now
March 13th, 2015 3:06pm

I tried unsetting the attribute, and Remove-MailboxDatabase now complains about a different user, so that must be it.

Unfortunately, I may have several hundred with this attribute set incorrectly.  I'm trying to find a way to find and clear them recursively with PowerShell.

March 13th, 2015 3:44pm

I was able to resolve my issue.  Thanks for your help.  I had 775 users with the wrong attribute set.  I ended up clearing them like this:

PS AD:\DC=mydomain,DC=local> $usersToChange = dir -rec | ? {$_.objectClass -eq "user"} | ? {(get-itemproperty -name msExchArchiveDatabaseLink -path $_.pspath) -like "*Mailbox Database 1096099116*"}
PS AD:\DC=mydomain,DC=local> $usersToChange | foreach {Clear-ItemProperty -Name msExchArchiveDatabaseLink -Path $_.PSPath -verbose}

Now I can proceed with Exchange uninstallation.

Free Windows Admin Tool Kit Click here and download it now
March 13th, 2015 5:57pm

I was able to resolve my issue.  Thanks for your help.  I had 775 users with the wrong attribute set.  I ended up clearing them like this:

PS AD:\DC=mydomain,DC=local> $usersToChange = dir -rec | ? {$_.objectClass -eq "user"} | ? {(get-itemproperty -name msExchArchiveDatabaseLink -path $_.pspath) -like "*Mailbox Database 1096099116*"}
PS AD:\DC=mydomain,DC=local> $usersToChange | foreach {Clear-ItemProperty -Name msExchArchiveDatabaseLink -Path $_.PSPath -verbose}

Now I can proceed with Exchange uninstallation.

March 13th, 2015 9:57pm

Were those users enabled for an archive previously?  If so how?
Free Windows Admin Tool Kit Click here and download it now
March 14th, 2015 12:27pm

Hi,

Thanks for your sharing. It's great to hear the good news.

Besides, I would like to verify if you enable archive for users and don't migrate achieve mailboxes.

Best regards,

March 16th, 2015 4:46am

I don't know if they used Exchange archiving previously.  They currently use a 3rd party archiving product with journaling.

There are no Exchange archive mailboxes anywhere in the organization.


  • Edited by Karl_MCS 18 hours 30 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 16th, 2015 8:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics