When an Exchange Server 2010 Database Availability Group has been upgraded to Exchange 2010 SP1 you may encounter an error when adding or removing database copies on a DAG member.
Summary: 1 item(s). 0 succeeded, 1 failed.
Elapsed time: 00:00:00
Mailbox Database 02
Registry key has subkeys and recursive removes are not supported by this method.
An unexpected error has occurred and a Watson dump is being generated: Registry key has subkeys and recursive removes are not supported by this method.
Exchange Management Shell command attempted:
Add-MailboxDatabaseCopy -Identity ‘Mailbox Database 02' -MailboxServer ‘EX2' -ActivationPreference ‘2'
Elapsed Time: 00:00:00
An event log entry is also logged on the Exchange server.
Log Name: Application
Source: MSExchange Common
Date: 10/13/2010 10:47:19 PM
Event ID: 4999
Task Category: General
Watson report about to be sent for process id: 3372, with parameters: E12, c-RTL-AMD64, 14.01.0218.015, RemotePowershell, mscorlib, M.W.RegistryKey.DeleteSubKey, System.InvalidOperationException, 829, 02.00.50727.4952.
The error will occur for both adding and removing database copies. When removing a database copy from a DAG member the action is still successful despite the error, however when adding a database copy to a DAG member the action is not successful.
This is a known issue with Exchange 2010 SP1 upgrades as reported by the Microsoft Exchange Team. The error occurs because of a registry key on the server that you are trying to add or remove the database copy from.
To locate the registry key you first need to know the GUID of the mailbox database. From the Exchange Management Shell run the Get-MailboxDatabase command to view the GUID.
[PS] C:\>Get-MailboxDatabase "Mailbox Database 02" | fl guid
Guid : ccfd3c4a-6187-4253-aa31-99a15c33546c
Once the GUID is known you can remove the offending registry key.
[PS] C:\>Remove-Item HKLM:SoftwareMicrosoftExchangeServerv14ReplayStateccfd3c4a-6187-4253-aa31-99a15c33546cDumpsterInfo
Note: substitute your own GUID in place of the one in the above command string.
Repeat the command on any additional Exchange 2010 DAG member servers that you also want to add the database copy to.
After you have removed the registry key you can retry adding the database copy to the Exchange server, and it should now be successful.