User get onmicrosoft.com instead of default domain

Brass Contributor

Hi,

 

I got an environment with a local AD, synced with AAD. If I create a user on the local AD with User.LogonName@mydomain.com and sync this with AAD. The user get the right UPN in AAD, also in admin.microsoft.com -> users.

 

Mydomain.com is default. But only in Exchange Online the user get User.LogonName@mydomain.onmicrosoft.com. I can quick fix that to fill the Mail attribute in the Local AD and sync this again. But I want to fix it that if I create a user, he get the right email domain in Exchange Online.

 

Also under EXO -> accepted domain is mydomain.com as default.

 

Please guys help me out,

 

Thanks in advance

 

Ricardo

 

 

5 Replies
Without exchange Onpremises which sets this I believe you need to set the primary email address in AD (mail/proxyaddresses attribute ) manually
Normally with many users I’d do this with powershell

@adam deltinger  Thank you for the fast reply. You are right we don't have on-premises exchange online. Is it possible to let  Active Directory run a script automatically (after creating a new user) so he can set the primary address? 

Yes, it is and that's the way to go: you need to be sure your AD is well prepared in terms of user attributes to make the sync in the right way
Yeah, bulk update existing users with a script and make a script running for each new user
Alright, thanks guys for helping me out :)