Script: Fix-ProxyAddress.ps1

I recently blogged about the “MigrationPermanentException: The target mailbox doesn’t have an SMTP proxy matching ‘’.” error message that occurs when attempting to perform a remote mailbox move for a user that doesn’t have the correct SMTP proxy address. I put together a script to help simplify the process of adding the relevant SMTP proxy address to effected users.

Once launched, the script will prompt for your tenant routing domain in the format ‘’ and will search for all mailboxes in the organization that do not have an email address policy applied. A new SMTP proxy address will be added to all mailboxes without an email address policy. The proxy address will be based on the alias of the primary SMTP address and the routing domain entered, e.g if the primary SMTP address is and the routing domain entered is the resulting proxy address will be

Requirements: This script has been tested and is known to work with Exchange 2010 and Exchange 2013.

Usage: There are no parameters or switches, simply execute the script:


Execution Policy: The script has been digitally signed and will run just fine under a “RemoteSigned” execution policy.





Download: I have published it to the TechNet Gallery, it can be downloaded by clicking here…

Post navigation


  • Patricia McLelland

    This is awesome! Thank you. I am getting an error though (it’s red), can you help me?

    Set-Mailbox : Cannot bind parameter ‘EmailAddresses’. Cannot convert the “Syste
    m.Collections.Hashtable” value of type “System.Collections.Hashtable” to type ”
    At C:\users\bigpmclelland\desktop\Fix-ProxyAddress.ps1:541 char:49
    + Set-Mailbox $Mailbox -EmailAddresses <<<< @{add="$Alias@$Routing
    + CategoryInfo : InvalidArgument: (:) [Set-Mailbox], ParentContai
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Exchang

  • Chris

    Hi Patricia,

    Could you tell me a little about your environment? OS/Exch version, etc? Feel free to email me directly if you’d rather not share than info publicly.



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>