Link to home
Start Free TrialLog in
Avatar of Linear-IT
Linear-ITFlag for United States of America

asked on

Ou Not found

I am trying to move my mailboxes from one domain to a completely new different domain.
I am using this command:
$SourceCredential = Get-Credential
$TargetCredential = Get-Credential
Move-Mailbox -TargetDatabase "exchange.lineartitle.local\First Storage Group\Mailbox Database" -Identity Abstrax1 -GlobalCatalog dc1.lineartitle.local -sourceForestGlobalCatalog domaincontroller1.lineartitleandclosing.local -NTAccountOU "OU=Visionnet,OU=Linear Users,DC=lineartitleandclosing,DC=local" -SourceForestCredential $SourceCredential -TargetForestCredential $TargetCredential

When I try to execute the script I get this error message:
Organizational unit "lineartitleandclosing.local/Linear Users/Visionnet" was not found. Please make sure you have typed it correctly.

I have gone through ADSI Edit to make sure that i can drive down through the tree and find the OU and User, which it does, on both domain controllers on the old domain.
I did not build the old domain, so I really cannot say for sure if they did it right.  From what I have seen and already fixed, it is not likely they did.
I have 150+ mailboxes to move over to match with the 150 Users i have already migrated with ADMT.
Any ideas.
Avatar of loki_loki
loki_loki

might be wrong but i thought you still had to specify the identity of the mailbox you want to move.  I used a text file of the users names and ran a powershell script against it.  I still have script somewhere if you want it.

Avatar of Linear-IT

ASKER

Yes, please by all means.  If you have that script it would be pretty helpful.
I have been under the assumption with the old domain, when running the script it was following the GC and all that mapped the user to the mailbox.  That is why I had the user defined in it.  Guessing I am wrong if i need to specify the mailbox too.
ASKER CERTIFIED SOLUTION
Avatar of loki_loki
loki_loki

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Loki Loki,
Sorry it took so long to let you know of the outcome.  Vacation came into play (Yes, I actually got to enjoy the vaca time too!)
I am getting an error when trying to pass the credentials.  I added a couple additional things to see if i could get the proper credentials per sourceGC, as where each mail server is on a separate new domain.
This is what I am running (with the mods)
 
$TargetCredential = Get-Credential
$SourceCredential = get-credential
$TargetDatabase = "exchange.lineartitle.local\First Storage Group\Mailbox Database"
$SourceFile = "c:\sourcefile.txt"
$a = remove-item c:\migration\MailboxMergeLog.txt -ea SilentlyContinue
$error.Clear()
$UserList = Get-Content $SourceFile
foreach($user in $UserList)
{
     $message = "Moving User -> " + $user
     write-output $message | out-file -filePath "c:\migration\MailboxMergeLog.txt" -append -noClobber
     move-mailbox -Identity $user -TargetDatabase $TargetDatabase -GlobalCatalog lineartitle.local -TargetForestCredential $TargetCredential -SourceForestGlobalCatalog domaincontroller1.lineartitleandclosing.local -SourceForestCredential $SourceCredential -BadItemLimit 10000000 -AllowMerge: $true -Confirm: $false
     if($error.Count -ne 0)
     {
           $message = "User " + $user + " failed to move ???????????"
           write-output $message | out-file -filePath "c:\migration\MailboxMergeLog.txt" -append -noClobber
           $message = "Error:::: " + $error[0].ToString()
           write-output $message | out-file -filePath "c:\migration\MailboxMergeLog.txt" -append -noClobber
           $error.Clear()
     }
}

Open in new window

here is the error.  It basically is telling me to make sure I am using the proper credentials.  Hence the added credential request.
 
Failed to reconnect to Active Directory server dc1.lineartitle.local. Ensure the server is available and that you are using
valid credentials.
At C:\mailbox.ps1:12 char:6
+       <<<< move-mailbox -Identity $user -TargetDatabase $TargetDatabase -GlobalCatalog dc1.lineartitle.local -TargetForest
Credential $TargetCredential -SourceForestGlobalCatalog domaincontroller1.lineartitleandclosing.local -SourceForestCredentia
l $SourceCredential -BadItemLimit 10000000 -AllowMerge: $true -Confirm: $false
    + CategoryInfo          : NotSpecified: (:) [], ADTransientException
    + FullyQualifiedErrorId : 9C93F85A

Open in new window


Any ideas?
glad you enjoyed your vacation!

ok, so you have the old domain, the new domain and a seperate new exchange domain?
which domain are you running the script in?
does the accounts you are using have exchange and domain admin rights in the domains?  When I did it I ran the script in the new domain, which also contains the exchange server, as the new domain admin.  
Can the accounts you are using manually create users and mailboxes?
The script is working nicely, found where the issue was.  Turns out the mailbox database was not the right name where the test user mailboxes resided.  There were a few other oddities too.  The original mail server that was almost decommissioned (almost for reasons of the new one blew up on me), had some strange names and a few other things.  Once finally going through every step of the script and comparing it to the source server i was able to get it working.  Great little script!  Thanks for the help.