Home » Exchange Server » Manually Configuring Email Addresses for Exchange Server 2013 Recipients using PowerShell

Manually Configuring Email Addresses for Exchange Server 2013 Recipients using PowerShell

Managing email addresses for a mailbox is a good learning experience for dealing with multi-value attributes in PowerShell.

A mailbox can have multiple email addresses, for example where a company has rebranded and changed their primary email addresses to a new name, but still wish to keep receiving any emails sent to the old email addresses.

Another example is a person who has a name that is very long or easy to misspell. In these cases you can add a secondary address that is shorter or easier to spell to the mailbox.

Here is the current email address for my test mailbox. At the moment it has just one email address.

We’ve already looked at some examples of using Set-Mailbox to manage mailboxes. So you might go ahead and use it to add an email address to a mailbox like this.

The command fails because the mailbox has an email address policy applied to it. Following the suggestion in the warning message we can go ahead and disable the email address policy to be able to make the change to the mailbox.

This time no errors or warnings were returned. Let’s take a look at the result.

Whoops! Instead of adding an extra email address, the original email address has been overwritten. Let’s revert back to the original configuration and try again.

Now let’s explore this concept of multi-value attributes a little more. Here is a mailbox that already has multiple email addresses assigned to it.

Using Get-Member we can see that the EmailAddresses attribute is a collection.

We can also expand the collection to see more details about each individual entry. Notice differences such as IsPrimaryAddress, and the ability to have a Prefix (i.e. for address types other than SMTP).

When we used Set-Mailbox in the earlier example it overwrote the existing attribute with the new value, rather than insert or append the new value to the existing one.

To get the desired result we need to use different syntax. Don’t worry, it isn’t difficult at all.

It’s as simple as that. Here is the result. The email address policy is still applying the primary email address of paul.cunningham@exchange2013demo.com, but the shorter address of paulc@exchange2013demo.com has been added as well.

Want to remove an address instead? Just as easy.

In the example above the primary email address for the mailbox has remained the same and additional email addresses have been added or removed.

If you need to change the primary email address for the mailbox instead, then there is a slightly different approach used.

First you need to disable email address policies for the mailbox. Don’t worry; this does not remove any of the email addresses that the policy has already added.

Next we need to use Set-Mailbox and provide the entire set of email addresses that we want to exist on the mailbox, using the case-sensitive prefix “SMTP” to specifiy which one is the primary address.

Let’s take one last look at the results.

As you can see the paulc@exchange2013demo.com email address was added to the mailbox and was made the primary email address as well.

Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server


  1. Tunde says:

    Thanks, Paul. I feel really silly reading this article because I thought, Ohh…I know how to do all this, then I saw that simple @{Add=”SmtpAddress’}. I never knew I could objects to arrays like that. Here is the same of how I’ve been doing similar thing.
    $OwnerMailbox = Get-Mailbox $Owner
    $UserMailbox = Get-Mailbox $User
    $OwnerMailbox.GrantSendOnBehalfTo += $UserMailbox.DistinguishedName
    Set-Mailbox $OwnerMailbox.alias -GrantSendOnBehalfTo $OwnerMailbox.GrantSendOnBehalfTo

    All that replaced by one simple expression.
    Thanks again!!!

  2. Petemoss007 says:

    I have the exact scenario you mentioned at the beginning. A company with many users all with more than one email address. The company is rebranding from CompanyA to CompanyB. So I need a powershell command to check all users and, if they have an email ending in @companyA.com that is set to the primary, I need to add that user an email address ending in @companyB.com and make it the primary while leaving all the existing email addresses in place.

  3. Petemoss007 says:

    My issue is that these users are in multiple OU’s, multiple departments, etc. If I could setup a new policy and have a custom attribute that says “if the users primary email ends in @companA.com” then it would work. But I have to find all the users in all the OU’s with a primary email address ending in @companyA.com and add a new email address and make it primary.

    When I looked at custom attributes I did not see where I could specify anything like the above.

    Also, thank you so much for trying to help me with this.

    • Read the article I linked to above, particularly the PowerShell example towards the end. You can use -RecipientFilter to be as broad or as specific as you need to.

      If you’d rather just write a script that’s fine, I’m just suggesting email address policies may be another solution for you.

  4. Petemoss007 says:

    I’ll look at the script. I’d prefer to use an email policy but since I cannot specify applying it to only the people with a specific domain name in their primary email address, I will probably have to use the script somehow.

  5. Saul Nolasco says:


    Hopefully you are still reading this comment thread. Is there a way to set that parameter to false at a global level? Doing it for all of the mailboxes, This has been causing issues for some of my users and I have +500 to take care of. Doing one by one can get a bit tedious.


  6. Courtney says:

    Hi Paul,

    We used to be on Exchange 2003 where Recipient Policies controlled the Email address policy. Many of our older mailboxes have multiple email addresses that I need to remove. I can search the EmailAddresses multi-value field for the mailboxes that have that email domain that we don’t use, but I don’t know how to remove them. Since the Recipient Policy created them all, they are all created with the following format “alias@old.emaildomain.com”. How would I script it using a variable for alias? Sorry, I’m doing great with CMDLETs but haven’t scripted much.

    Thanks so much!

  7. Courtney says:

    Wait, Could I just do the following?
    get-mailbox -resultsize unlimited |Set-Mailbox -EmailAddresses @{Remove=’*@old.emaildomain.com’}


  8. Rene says:


    I have several users with multiple e-mail addressen, I would like to change there primary addresses but when i set a new default email adresses the other addresses are deleted.
    I only need to change the Isprimary flag but I can’t it tells me that it’s readonly

    Is there a simple way of doing this ?

  9. MHD says:

    Hello dear,
    I have a question about Ms -Exchange 2013, hope you can help me about that.
    i have a distribution group named “support”, toe people (sam, mike) are member of group.
    they both receive any email had sent to this group.
    it is important that all their outgoing email send by support account ,not their own account.
    they only solution that i khnow is using “send As permission” but we are not sure they do this every time that they want send email.
    is there any other reliable solution for that?
    i really really appreciative your time and help.
    Thank you in advance.

  10. Hans Peeters says:


    We need to change primary email address for most of our 2500 mailboxes. For specific reasons we connot use Email Address Policies, we need to use powershell.
    At the end of this article we have found the powershell command.
    All working fine in lab.
    However we noticed that other types of addresses like SIP and X400 disappear.

    How can we change primary smtp address by keeping SIP and X400 address of mailbox?


  11. Lars Panzerbjørn says:

    Thanks for the article 🙂

    I am trying to add an email address and make it the Primary SMTP Address, but without having to copy out all the other addresses first, but I can’t really figure out how to do it.

    I tried:
    Set-Mailbox -Identity $Alias -EmailAddresses @{add=’smtp:panzer@bjrn.com’}

    But that doesn’t seem to do the trick. It just adds the address.

    Is what I’d like to do even possible?

  12. Carl Frank says:


    Great Stuff!

    Question: We just migrated 450 mailboxes from on prem exchange 2010 to O365 Enterprise and, in the cloud the mailbox email addresses have all applied the UPN as the SIP address. This is breaking the functionality between Outlook and Lync as the Default SMTP addresses in most cases are not the same as the UPN.

    I tested by adding SIP addresses to the proxy attribute for a few accounts on premises and after running dirsync, they are now correct in the cloud. Currently there are no SIP addresses on premises, so I am trying to identify a way to create a SIP address that mirrors the default SMTP address in bulk on the Exchange 2010 side.
    Any thoughts would be appreciated. I aqm getting up to speed on Powershell, but still quite a novice.

    • Steve Rackham says:

      Hi Carl
      Did you ever find out how to do this?
      I have a similar scenario where I want to add the SIP address based on primary SMTP address.
      Thanks for your help.


      • Steve Rackham says:

        Hi All
        I muddled my way through and came up with the following which worked beautifully.

        ForEach ($mbx in $mbxes) {
        $newSIP = ‘SIP:’ + $($mbx.PrimarySmtpAddress)
        Write-Host “Adding $newSip to” $mbx.SamAccountName

        Set-Mailbox -Identity $mbx.SamAccountName -EmailAddresses @{Add = $newSip}

  13. JP O Leary says:

    Hi Paul,

    The article above is very good.

    What powershell script would I use to delete a specific smtp address from all users in a domain?

    For example I want to delete all smtp address ending in source.local or target.local.



  14. Glenn says:

    Hi Paul,
    I am trying to add secondary smtp addresses to remote cloud mailboxes using import-csv.

    When I try using this , to have it read from each line the of csv’s proxyaddresses column, it fails as it appears to see the “$_.proxyaddresses” as an invalid smtp address and not read and use the correct addresses from the file.

    Any thought I what I am missing?


    • Glenn says:

      Sorry , seems to have dropped this when I posted.

      This is what I am using that does not read from the csv file
      -EmailAddresses @{add=”$._proxyaddresses”}

  15. abdullah says:

    hello Paul
    which permission does the user need to change email address ?
    i need the specified permission


  16. Angelos says:

    hi guys
    great article as always – but I have the same issue about putting proxy addresses on CONTACTS .

    before in 2010 I was able to set ANY email address as proxy address/alias to the email address. Now in 2013 I can only put INTERNAL emails domain, so that goes out… (at least from the ECP)

    would the same / similar commands run on the contact?

    the thing is when a contact has changed an email address, we usually keep the old on in for a while to avoid people sending to the “wrong” – old email address, as then exchange would reroute this email to the “PRIMARY EXTERNAL EMAIL ADDRESS”. But now in 2013 you are only able to add internal addresses, in which case you cannot do this any more.


    • If people are picking the contact from your GAL or their auto-complete cache I don’t see how keeping the old address associated with the contact helps.

      At any rate, what you’re seeing is how I’d expect it to behave, so there’s no other way to do it that I’m aware of.

      • angelos says:

        It does help as the exchange will only send to the contact on its external email address. So if they send to one of the proxy addresses the exchange will automatically reroute it to the external email address. That way if someone used the old address by mistake it will still go to the correct one. Tried and tested 100% 🙂

        So the question is still if there is a way to see and modify the proxy addresses on a contact via command line. Unfortunately the mailbox proxy command arguments don’t work on the contacts…

  17. Vik says:

    I have a user who is on office 365 and i need change her alias proxy address. At first the alias to logon to the webmail for 365 emails was different so now i need to change the alias and email address will remain the same. Is there a script i se for that i am not sure if this is correct.

    Set-Mailbox -Identity $Alias -EmailAddresses @{add=’smtp:xxxxx@yurowndomain.com’

  18. Phil Ready says:

    Hi Paul
    How can I make a new EmailAdressPolicy default? I see I cannot delete the old policy until I make the new one default, but cannot find the command.


    • When multiple email address policies exist the policy that “wins” is the one that has a filter that matches the recipient in question. If multiple policies match then the highest priority policy wins.

      The Default Policy has a priority of “Lowest” and is designed to catch all recipients that other policies do not match.

  19. tarun says:

    i have added secondary email address but when i sent the test mail to secondary email address, i have received that email that’s fine, but if some one will send an email to anyone though it is secondary or primary how we can verify who has received an email? primary or secondary.


  20. Fernando says:

    Hi Paul. This post is very useful however I’m a little confused about -EmailAddresses parameter.
    I’ve seen this parameter for Set-Mailbox as well as for Set-MailUser and I don’t understand the differences.
    Some internet post says Set-Mailbox is for Exchange On-Premises and Set-MailUser is for Office 365 but at Microsoft web site doesn’t seem to be so clear about it.

    I’ll appreciate your comments.

    Thanks a lot!

    • Mailboxes and mail users are two different recipient types. You can read about all the different recipient types here:


      Basically, Set-Mailbox would be used for a Mailbox User, which is an Active Directory user that has a mailbox in the Exchange organization. This is the most common type of recipient.

      Set-MailUser would be used for a Mail User, one example of which is an Active Directory user who has a mailbox hosted in Office 365. Set-MailUser makes changes to the attributes in your Active Directory which will then synchronize with Office 365 via your directory synchronization (if you’ve deployed it in your particular scenario).

      Edit: not to be confused with an Office 365 mailbox user, which is for Hybrid scenarios. See the link above for details.

  21. Christian says:

    how can i change the setting for users of a special OU ?

    found this, but is not working in exchange 2016:
    Get-mailbox -OrganizationalUnit “OU name”| set-mailbox EmailAddressPolicyEnabled $true
    Argument true is not acceptet

Leave a Reply

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