Solved

Ou Not found

Posted on 2011-02-22
6
732 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
  • 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 500 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now