Forum Discussion

Deleted's avatar
Deleted
Apr 18, 2018

MS PowerShell Script for Staged Migration (Office 365)

Hello All,

I'm sharing this information about the PowerShell script Exchange2007MBtoMEU.ps1 (link: Convert Exchange 2007 mailboxes to mail-enabled users), used for staged migration of e-mail from Exchange 2007 to Office 365 (link: Perform a staged migration of email to Office 365).

 

I think the parameter "DomainController" is missing in two cmdlets inside LookupADInformationFromSMTPAddress function:

 

$Mailbox = Get-Mailbox $CSV.OnPremiseEmailAddress -ErrorAction SilentlyContinue

...and...

 

$UserInfo | Add-Member -Type NoteProperty -Name DistinguishedName -Value (Get-User $Mailbox.Identity).DistinguishedName

You get an error, running the script, if migrating mailbox user is member of an AD domain different by domain hosting Exchange 2007 environment.

 

This is the correction:

 

$Mailbox = Get-Mailbox $CSV.OnPremiseEmailAddress -DomainController $DomainController -ErrorAction SilentlyContinue

...and...

 

$UserInfo | Add-Member -Type NoteProperty -Name DistinguishedName -Value (Get-User $Mailbox.Identity -DomainController $DomainController).DistinguishedName

 

Regards,

Luca

  • You can leave this feedback directly to the article authors by using the Feedback link ("Was this information helpful?") on the bottom.

Resources