[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Ou Not found

Posted on 2011-02-22
6
Medium Priority
?
752 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:Linear-IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:loki_loki
ID: 34952926
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.

0
 

Author Comment

by:Linear-IT
ID: 34952981
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.
0
 
LVL 4

Accepted Solution

by:
loki_loki earned 2000 total points
ID: 34953045
Here you go.  Fill in your domain information to the relevant bits.  This script will also merge mailboxes if they already exist but if you don't want that just delete the '-AllowMerge: $true '  pretty basic script but it worked for me.  


$SourceCredential = get-credential
$TargetDatabase = "enter your database here"
$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 enteryourtargetgc -SourceForestGlobalCatalog entersourcegc -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()
     }
}
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:Linear-IT
ID: 35008799
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?
0
 
LVL 4

Expert Comment

by:loki_loki
ID: 35015276
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?
0
 

Author Comment

by:Linear-IT
ID: 35021864
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.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question