Exchange Server 2007: Sample Script to Help with Lotus Notes to Exchange 2007 Migration

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 […]

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.

Microsoft, Exchange Server 2007, Lotus Notes, Domino, Scripting, Tips and Tricks, Knowledgebase

Source:? Exchange Team Blog