Exchange 2007 move-mailbox script for bulk move using powershell
Posted on 2008-10-05
We are about to move users cross forest from Exchange 2003 to Exchange 2007. We have tested the command below which works perfect for moving a single mailbox. As I am not an expert with powershell, can somebody assist with creating a script that will do a bulk move of mailboxes based on a txt file with users aliases (or sam account).
This is what we have completed for 1 mailbox:
$SourceCredential = Get-Credential (This is the username and password for source domain)
$TargetCredential = Get-Credential (This is the username and password for target domain)
Move-Mailbox -TargetDatabase "EX07\First Storage Group\Small Mailboxes" -Identity eric_sdaly -GlobalCatalog dc01.targetdomain.local -SourceForestGlobalCatalog dc01.sourcedomain.com SourceDomainController dc01.sourcedomain.com -NTAccountOU "OU=Secure,OU=Ireland,OU=User Accounts/Groups,DC=targetdomain,DC=local" -SourceForestCredential $SourceCredential -TargetForestCredential $TargetCredential -SourceMailboxCleanupOptions MailEnableSourceAccount
Hope someone can help on this.