Changing Primary SMTP address in an ADFS/DirSync Environment

This question is answered This question is answered

Hello all,

Looking for some help here.  We have our 365 environment up and running with ADFS and DirSync enabled.  Seems to be working very well.  However, we noticed that our primary email addresses are setup with the  For example rather than just  Our logins are good and using just using  Problem is that our reply from address is coming from


We saw that there is some PowerShell command called Set-Mailbox but for the life of us we cannot located the cmdlet. Can someone please provide some guidance on how we can get the primary email address updated given this environment


Thank you for the help!

Verified Answer
All Replies
  • Hi MADV1457,

    Thanks for your post. To ensure the STMP address match the domain name which the user uses in Office365 by using dirsync. We need to change the UPN on local and match the verified domain name.

    Let's say the user on local-domain named user@domain.local, we need to change the UPN to The domain name should be matched the verified domain name on Office365.

    Thanks, Neo Zhu

  • Hi Neo,

    Thanks for the response.  Problem is that was already done.  We changed all the user's UPN names in our on-premise AD and those are being reflected in O365 correct.  For example, when we look at a user's details, their username is properly sync'd with AD and showing which is correct.  However, the primary email address is still show  This is shown my drilling into the exchange mailbox settings for the user and is located under E-Mail Options.

  • Hi Neo Zhu,

    I'm working with MADV1457 on this issue. I wanted to clarify that prior to implementing ADFS and DirSync we added the desired UPN to our local AD in this case: was added as a UPN before converting the domain: (this domain was already verified in O365). The local AD has an original domain name of: we then immedidately added the UPN: to the local AD and then proceeded with gettting up ADFS and DirSync. I'm wondering if maybe causing O365 to be confused somehow?  

  • Hi RIC11003,

    As long as domain has been added and verified in Office 365, nothing would confuse Office 365 for syncing users. If you are working with MADV1457, please use ADSIEdit.msc to check the the following attributes in local AD.

    On-premises Active Directory attribute name Example On-premises Active Directory attribute value Example Exchange Online email addresses
    proxyAddresses Primary SMTP:
    Secondary SMTP:
    proxyAddresses Primary SMTP: Secondary SMTP:
    Primary SMTP:
    Secondary SMTP:
    Secondary SMTP:
    mail Primary SMTP:
    Secondary SMTP:
    UserPrinicpalName Primary SMTP:
    Secondary SMTP:

    Please update the corresponding attributes for local users, and force the DirSync to run to see if the primary SMTP address can be updated. 

    Reken Liu

    1 out of 1 people found this post helpful.

  • Hi Reken Liu,

    This is the fix!  This KB has all the details as well: (got this from Support)

    Thank you all for reponses!

  • Hi,

    Nice table. Everything is true but not for UPN.

    In my AD all users have correct UPN (<user>@<domain>.com), but synced users have <domain> addresses until I change 'mail' or 'proxyAddresses' to '<user>@<domain>.com'.



  • This is all fine and dandy and works perfectly BUT! I have 1000+ users that need to be migrated. Do i need to do this to all of the users individually or is there a tool that can do this?

    1 out of 1 people found this post helpful.

  • Hi all,

    Sorry for the delayed the response. For all the reasons, I’ll suggest creating a new case , so that we can take a look the environment and help you to work on it.

    Best Regards,