Moving to Office 365 – Mailbox Migration Error
Error: MigrationPermanentException “Target mailbox doesn’t have an SMTP proxy matching ‘<domain>.mail.onmicrosoft.com'” error when you try to move mailboxes to Exchange Online
Lets see how to add proxy addresses in bulk using powershell.
Issue happens only to users where email address policy is not enabled
–
Checking this Automatically Update Email Address on bulk for multiple mailboxes can give serious implications if the number of mailboxes are more .As in some environments people rename email address out of the email address policy for various reasons (Update/Customize,More friendly).
When you check Automatically Update Email Address . It will apply as specified in the policy like firstname.lastname@localhost or Alias@localhost which you can see in the email address policy settings.
Now lets see how to add the proxy address in bulk , Without updating the email address policy.
List Mailboxes where EmailAddressPolicyEnabled is False
Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddressPolicyEnabled -like "False"}
Export to CSV –
Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddressPolicyEnabled -like "False"} | Select-object Alias,PrimarySmtpAddress | Export-Csv UsersneedProxyaddress.csv
CSV looks like below –
Now Create a CSV like below Having the Custom Proxy address needs to be added to user mailboxes.
For Dummies – Using Excel Features.
To Add these Additional Proxy Addresses to these mailboxes –
Import-Csv AddProxyaddress.csv | ForEach-Object{Set-Mailbox $_.PrimarySmtpAddress -EmailAddresses @{add=$_.AddAddress}}
Verifying –
Import-Csv AddProxyaddress.csv | ForEach-Object{Get-Mailbox $_.PrimarySmtpAddress} | FT Emailaddresses
To Revert Back –
Import-Csv AddProxyaddress.csv | ForEach-Object{Set-Mailbox $_.PrimarySmtpAddress -EmailAddresses @{remove=$_.AddAddress}}