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: https://support.office.com/en-us/article/convert-exchange-2007-mailboxes-to-mail-enabled-users-a1f79f3c-4967-4a15-8b3a-f4933aac0c34?ui=en-US&rs=en-US&ad=US), used for staged migration of e-mail from Exchange 2007 to Office 365 (link: https://support.office.com/en-us/article/perform-a-staged-migration-of-email-to-office-365-83bc0b69-de47-4cc4-a57d-47e478e4894e#bkmk_step8).

 

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

1 Reply

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

Resources