Some On Premise mailboxes are provided with wrong external email address in Office 365

Regular Contributor

In some OnPremise mailboxes, the associated “mail users” in O365 are provided with the wrong external email address.

The target address for mail users is set wrong by Azure AD Connect.

Our customer has a hybrid exchange configuration, set up with AzureAD Connect and the Hybrid Configruation Wizard (HCW).
All users with Onpremise-mailboxes are replicated from AD Connect as mail users to O365. Some mail users have the right external email-adresse set as (correct) and some mail users have the external email address set to (wrong).
Target email address for on Premise mailboxes isn't set.
Why does Azure AD Connect set the wrong target address?

12 Replies



Hi, the users who are getting the .onmicrosoft addresses in O365 are most likely setup in on-premises AD with a domain.local UPN suffix as opposed to the routable domain name. You will need to set their UPN's in AD to have a suffix of as opposed to yourdomain.local.  This should correct the issue for the affected users.

@PeterRising could you explain more precisely the phrase:

"setup in on-premises AD with a domain.local UPN suffix as opposed to the routable domain name".


Thanks inn advance.



In Active Directory Users and Computers, open one of the affected users and go to the Account tab.


You will see that the UPN is set to username@domain.local.  Under the domain suffix part of the UPN, click the dropdown and select the actual email domain and the UPN should change to 


If you don't see the domain in the dropdown, you may need to add it as an additional UPN suffix in Active Directory Domains and Trusts.  However, as you have said that some of your users are syncing correctly, I am guessing the domain will be available to you in the dropdown.

@PeterRising I checked in Microsoft 365 admin center and Active Directory and the usernames are displayed correctly with the correct domain. The issue exists only in "Contacts" in Exchange Admin Center. Please check the attached screenshot.
What do you think, what could be the reason for that and how can I solve it?



Hi, so in your Exchange on-premises server, are the objects showing with the correct primary smtp email addresses?

Hi @PeterRising do you mean in Active Directory?

Please provide the path how to check  this.

Thanks in advance.



Do you not have an on premises Exchange Server?

@PeterRising There are 2 Exchange servers. Please check the screenshot.
The main problem is that, some on prem mail users are shown with wrong "external email address" in "Contacts" in Exchange Admin Center. The wrong email address is the secondary email address which ends with
When trying to edit manually the external email address, it comes the following error message:
"The operation on mailbox failed because it's out of the current user's write scope.
The action ‘Set-MailUser’, ‘ExternalEmailAddress’, can’t be performed on the object because the object is being synchronized from your on-premises organization".

@AtanasM I'm with the Sam issue , did you get the solution ?


best response confirmed by AtanasM (Regular Contributor)

@Jjsilva @AtanasM 


Apologies, I lost track of this issue.  The reason that the email address could not be changed is the Source of authority is on-premises AD, not Azure AD.  To change this email address you would need to do so from the on-premises Exchange Admin Centre, not the Exchange Online one.

@PeterRising Hello the problem is when the on-premise user is sync to cloud it gets the wrong external smtp address although the upn of the user is correct with the