Hello,

I'm having a few issues with power shell and migrating a bulk of users from a forest in 2003 to a forest 2007.

The two forests exist and there is a full trust between them, DNS has been set up so everyone can see everyone else.

The way I'm doing this is to migrate a user first using the migrate tool then the mailbox using this command:

$s=get-credential # (use your AD Account)
$t=get-credential # (use your CIG Account)

$s=Move-mailbox -TargetDatabase "MYMAIL07SERVER\First Storage Group\Mailbox Database" -BadItemLimit:"214" -identity "USER@OLD.DOMAIN" -GlobalCatalog NEWDC.DOMAIN.local -SourceForestGlobalCatalog OLDDC.DOMAIN.local -NTAccountOU "OU=BLAH,OU=BLAH,DC=NEWDOMAIN,DC=local" -MaxThreads 8 -SourceForestCredential $s -TargetForestCredential $t


Works perfectly but I want to use a csv (or text) to migrate users in bulk, so I migrated the user and entered the details into the csv file:

Username,
TL,


And used this script:


Import-CSV c:\scripts\users.csv | Get-Mailbox -Identity {$_.Username} | Move-Mailbox -TargetDatabase

"MYMAIL07SERVER\First Storage Group\Mailbox Database" -GlobalCatalog NEWDC.DOMAIN.local -SourceForestGlobalCatalog

OLDDC.DOMAIN.local -IgnorePolicyMatch -NTAccountOU "OU=BLAH,OU=BLAH,DC=NEWDOMAIN,DC=local" -BadItemLimit 214 -MaxThreads 10 -SourceForestCredential $SourceCredential -

TargetForestCredential $TargetCredential


But I keep getting the same error and have no idea what i'm doing wrong:


Get-Mailbox : The operation could not be performed because object 'TL' could no
t be found on domain controller 'NEWDC.DOMAIN.local '.
At C:\Scripts\MultipleMBmRD.ps1:1 char:46
+ Import-CSV c:\scripts\users.csv | Get-Mailbox <<<< -Identity {$_.Username} |
Move-Mailbox -TargetDatabase "MYMAIL07SERVER\First Storage Group\Mailbox Database"
-GlobalCatalog cigbridc02.cig.local -SourceForestGlobalCatalog bridc01.ad.broad
system -IgnorePolicyMatch -NTAccountOU "OU=Blah,OU=BLAH,DC=NEWDOMAIN,DC=local" -BadItemLimit 214 -MaxThreads 10 -SourceForestC
redential $SourceCredential -TargetForestCredential $TargetCredential



Any help would be really appreciated, thanks.

RobD