Move-Mailbox fails cross forest with "-2147467259" The specified mailbox database "database specified" does not exist.

In this scenario we were working with the same command the day prior and mailbox moves were processing just fine. The day prior we had set the variable for -SourceForestCredential and -TargetForestCredential using $SourceCredential and $TargetCredential variables following KB : How to Move a Mailbox Across Forests.

1. On the Exchange 2007 server where you will run the Move-Mailbox cmdlet, in the Exchange Management Shell, run the following command to create a credential object:

$SourceCredential = Get-Credential

 You will be prompted for credentials. Specify an account that has permissions to move the mailboxes in the source forest.

2. On the Exchange 2007 server where you will run the Move-Mailbox cmdlet, in the Exchange Management Shell, run the following command to create a credential object:

$TargetCredential = Get-Credential

You will be prompted for credentials. Specify an account that has permissions to move the mailboxes in the target forest.

3. On the Exchange 2007 server, in the Exchange Management Shell, run the Move-Mailbox command to move the mailbox. For example:

Move-Mailbox -TargetDatabase "Target Server\First Storage Group\Mailbox Database" -Identity john -GlobalCatalog GC01.fabrikam.com -SourceForestGlobalCatalog GC02.contoso.com -NTAccountOU "OU=OrgUnit01,DC=fabrikam,DC=com" -SourceForestCredential $SourceCredential -TargetForestCredential $TargetCredential

The result was today was:

IsWarning="False" ErrorCode="-2147467259">The specified mailbox database "Target Server\First Storage Group\Mailbox Database" does not exist.

We decided to run the command this time and debug what was going on. We started a transcript log by issuing the "Start-Transcript C:\movemailbox.txt -Append" and ran the MoveMailbox as so:

Move-Mailbox -TargetDatabase "TargetServer\First Storage Group\Mailbox Database" -Identity john -GlobalCatalog GC01.fabrikam.com -SourceForestGlobalCatalog GC02.contoso.com -NTAccountOU "OU=OrgUnit01,DC=fabrikam,DC=com" -SourceForestCredential $SourceCredential -TargetForestCredential $TargetCredential -Debug -Verbose

We then issued a "Stop-Transcript" and pulled our movemailbox.txt file up in notepad and the output looked like so:

*NOTE*

Some of the null output has been snipped for brevity. 

**********************

Windows Power Shell Transcript Start

Machine : Target Server (Microsoft Windows NT 6.0.6001 Service Pack 1)

**********************

Transcript started, output file is c:\movemailbox.txt

[PS] C:\Windows\System32>

Move-Mailbox -TargetDatabase "TargetServer\First Storage Group\Mailbox Database" -Identity john -GlobalCatalog GC01.fabrikam.com -SourceForestGlobalCatalog GC02.contoso.com -NTAccountOU "OU=OrgUnit01,DC=fabrikam,DC=com" -SourceForestCredential $SourceCredential -TargetForestCredential $TargetCredential -Debug -Verbose

VERBOSE: Move-Mailbox : Beginning processing.

VERBOSE: Move-Mailbox : Searching objects "TargetServer\First Storage Group\Mailbox Database" of type "MailboxDatabase" under the root "$null".

VERBOSE: Move-Mailbox : Previous operation run on domain controller 'GC02.contoso.com'.

VERBOSE: Move-Mailbox : Searching objects "john" of type "ADUser" under the root "$null".

VERBOSE: Move-Mailbox : Previous operation run on global catalog server 'GC02.contoso.com'.

VERBOSE: Move-Mailbox : Processing object "contoso.com/Corporate/My Policy/OrgUnit01".

VERBOSE: Move-Mailbox : Searching objects "SourceServer" of type "Server" under the root "$null".

VERBOSE: Move-Mailbox : Previous operation run on domain controller 'GC02.cotoso.com'.

VERBOSE: Move-Mailbox : Searching objects "TargetServer\First Storage Group\Mailbox Database" of type "MailboxDatabase" under the root "$null".

VERBOSE: Move-Mailbox : Previous operation run on domain controller 'GC02.contoso.com'.

Confirm

The specified mailbox database "SourceServer\First Storage Group\Mailbox Database" does not exist.

[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):y

Move-Mailbox : The specified mailbox database "SourceServer\First Storage Group\Mailbox Database" does not exist.

At line:1 char:13

+ Move-Mailbox <<<< -TargetDatabase "TargetServer\First Storage Group\Mailbox Database" -Identity john -GlobalCatalog GC01.fabrikam.com -SourceForestGlobalCatalog GC02.contoso.com -SourceForestCredential $SourceCredential -TargetForestCredential $Target Credential -debug -verbose

Identity : contoso.com/Corporate/My Policy/OrgUnit01

DistinguishedName : CN=OrgUnit01,OU=My Policy,OU=Corporate,DC=contoso,DC=com

DisplayName : OrgUnit01

Alias : john

LegacyExchangeDN : /o=mail/ou=First Administrative Group/cn=Recipients/cn=john

PrimarySmtpAddress : john@contoso.com

SourceServer : SourceServer.fabrikam.com

SourceDatabase : SourceServer\First Storage Group\Mailbox Database

SourceGlobalCatalog : GC02.contoso.com

TargetGlobalCatalog : GC01.fabrikan.com

TargetServer : TargetServer.fabrikam.com

TargetDatabase : TargetServer\First Storage Group\Mailbox Database

MoveType : CrossOrg

MoveStage : Initialization

StatusCode : -2147467259

StatusMessage : The specified mailbox database "SourceServer\First Storage Group\Mailbox Database" does not exist.

VERBOSE: Move-Mailbox : Ending processing.

[PS] C:\Windows\System32>stop-transcript

**********************

Windows PowerShell Transcript End

**********************

When we get this usually, it is a policy issue and adding -IgnorePolicyMatch will resolve the problem. However when we did this we still received the same error so, we now turned to the application logs. The only events in the application logs were 1022 errors and they were pointing to the mailbox we were trying to move:

Log Name: Application

Source: MSExchangeIS Mailbox Store

Event ID: 1022

Task Category: Logons

Level: Error

Keywords: Classic

User: N/A

Computer: SourceServer.fabrikam.com

Description:

Logon Failure on database "First Storage Group\Mailbox Database" - Windows account NT AUTHORITY\SYSTEM; mailbox /o=OrgUnit01/ou=First Administrative Group/cn=Recipients/cn=john.

So we tested the accounts being used for the $SourceCredential and $TargetCredential by attempting to logon the server which they had rights to do and found that they failed. We reset the passwords and now the accounts are able to logon, we re-ran the credential variables:

$SourceCredential = Get-Credential

$TargetCredential = Get-Credential 

Now the Move-Mailbox is functioning again, Happy Migrations!