Blog Post

Exchange Team Blog
2 MIN READ

Sample Script to Help with Lotus Notes to Exchange 2007 Migration

The_Exchange_Team's avatar
Sep 24, 2007

For those who wish to script the migration from Lotus Domino to Exchange 2007, PowerShell can be extremely helpful. I wrote the below script for a few customers who wanted more extensive control over their migration, this script can be easily tweaked to meet individual needs.

DISCLAIMER: This script is a sample only, not officially supported by Microsoft.

#Enter items specific to your environment below
$TargetDatabase = "EXCHANGE\First Storage Group\Mailbox Store"
$SourceFile = "c:\dominousers.txt"
$a = remove-item c:\miglog.txt -ea SilentlyContinue
$error.Clear()
$UserList = Get-Content $SourceFile
foreach($user in $UserList)
{
     $message = "Migrating User " + $user
     write-output $message | out-file -filePath "c:\miglog.txt" -append -noClobber
     move-dominomailbox $user -TargetMailboxDatabase $TargetDatabase
     if($error.Count -ne 0)
     {
           $message = "User " + $user + " failed migration"
           write-output $message | out-file -filePath "c:\miglog.txt" -append -noClobber
           $message = "Error: " + $error[0].ToString()
           write-output $message | out-file -filePath "c:\miglog.txt" -append -noClobber
           $error.Clear()
     }
}

What's going on here is the script is reading from a file called c:\dominousers.txt. This file should contain the list of mailboxes you wish to migrate. An example of the expected contents:

Marc Nivens/DOMINO
Nino Bilic/DOMINO
John Smith/DOMINO

So once you have your list of users in the file, all you need to do is run the script. It will move each user specified in the file and will log any errors to a log called c:\miglog.txt. This of course can be changed to meet more specific needs. An example of this would be changing the move-dominomailbox command to move-dominouser and specifying the correct switches. You could do the entire migration with just this script and a text file that contains the list of users that need to be migrated.

- Marc Nivens

Published Sep 24, 2007
Version 1.0
  • Greetings,

    Do you think that this is adaptable to Exchange 2003? I am stuck with a dilemma, in that I know that I have to use MailMig.exe in a batch file to migrate 30 users a day, but I cannot find a real life example to do just that.

    The context:

    Lotus Notes
    Exchange server 2003
    800 users

    I understand that there is a control file. The rare examples in TechNet are abstract. Does anyone have a real life example for a batch file for migrating 30 users a day, this could save my life.

    Cheers,

    Jimmy
  • I don't have any examples for 2003, I can tell you that this example is specifically for Exchange 2007 and the Notes Transporter Suite.
  • What parts of the data does this script migrate from notes ? This script is awesome ... can you pl. add some details as to what and how exactly the script works .

    thanks
  • The move-dominomailbox command has a option for -maxthreads.  My understand with this switch is to be able to move multiple people at the same time.

    What is the format of piping in the users and taking advantage of the --maxthreads option.

    I would like to migrate 16 users and I want to set the maxthreads to 4 therefore when the number of migrated users drops below 4 users a new users out of the 16 will start migrating.

    Is this possible?
  • I'm also interested in Ted's question? Any idea how to run migration with parameter MaxThreads?

    Thanks in advance!