Home

AAD Connect sync local mail attribut as cloud UPN

%3CLINGO-SUB%20id%3D%22lingo-sub-541443%22%20slang%3D%22en-US%22%3EAAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-541443%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%3CP%3Eduring%20installation%20of%20Azure%20AD%20Connect%20and%20synching%20on-premise%20user%20accounts%20into%20my%20cloud%20tenant%20and%20matching%20these%20with%20already%20existing%20cloud%20only%20accounts%2C%20I%20run%20into%20the%20problem%20that%20the%20on-premise%20UPN(custom%20built%20from%20name%20and%20surname)%20is%20set%20as%20cloud%20UPN%20and%20not%20the%20proxy%2Fmailaddress%20of%20my%20testaccounts.%3C%2FP%3E%3CP%3EI%20simply%20want%20that%20AAD%20Connect%20sets%20the%20mail%20or%20proxyaddress(SMTP%3A...)%20attribut%20as%20UPN%20for%20the%20matched%20cloud%20accounts%2C%20which%20already%20have%20their%20mail%20address%20as%20UPN%20but%20after%20synchronization%20these%20correct%20UPNs%20are%20gone.%3C%2FP%3E%3CP%3EThe%20cloud%20domain%20is%20set%20up%20as%20upn%20suffix%20on-premise%20and%20the%20domain%20is%20verified%20in%20the%20tenant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20configuration%20I%20can%20change%20or%20adjust%20e.g.%20in%20the%20rules%20editor%20of%20AAD%20Connect%20or%20somewhere%20else%20which%20solves%20my%20problem%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20that%20I%20can%20set%20the%20UPN%20via%20powershell%20to%20the%20correct%20one%20after%20sync%20but%20this%20can't%20be%20the%20best%20way%20to%20do%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3CP%3EJulian%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-541443%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542261%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542261%22%20slang%3D%22en-US%22%3E%3CP%3EWhy%20is%20that%20a%20problem%2C%20it's%20the%20expected%20behavior.%20If%20you%20want%20to%20customize%20this%20behavior%2C%20you%20have%20to%20play%20with%20the%20default%20sync%20rules.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20the%20logic%20used%20by%20the%20rules%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EIIF(IsPresent(%5BuserPrincipalName%5D)%2C%5BuserPrincipalName%5D%2C%20IIF(IsPresent(%5BsAMAccountName%5D)%2C(%5BsAMAccountName%5D%26amp%3B%22%40%22%26amp%3B%25Domain.FQDN%25)%2CError(%22AccountName%20is%20not%20present%22)))%3C%2FPRE%3E%0A%3CP%3EIn%20other%20words%2C%20if%20the%20UPN%20value%20is%20populated%2C%20it%20will%20use%20that.%20If%20the%20UPN%20value%20is%20not%20populated%2C%20the%20SamAccountName%20attribute%20is%20used%2C%20combined%20with%20the%26nbsp%3B%40%20sign%20and%20the%20domain%20name.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542777%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542777%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Vasil%2C%20well%2C%20it's%20a%20problem%20because%20it's%20annoying%20to%20work%20around%20atm.%3C%2FP%3E%3CP%3EIf%20there%20is%20a%20easy%20way%20to%20accomplish%20my%20goal%20without%20much%20effort%2C%20then%20I'll%20be%20happy%20but%20currently%20I%20haven't%20found%20anything%20useful.%3C%2FP%3E%3CP%3EAs%20I'm%20not%20familiar%20with%20these%20rules%20I%20haven't%20touched%20them%20yet.%3C%2FP%3E%3CP%3EIf%20I%20understand%20you%20correctly%20I%20just%20need%20to%20change%20in%20your%20string%20the%20%22userPrincipalName%22%20to%20%22mail%22%20at%20the%20correct%20place%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-544772%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-544772%22%20slang%3D%22en-US%22%3E%3CP%3EWell%2C%20for%20one%2C%20%22mail%22%20is%20not%20the%20same%20as%20the%20primary%20SMTP%20address%2C%20and%20we%20don't%20really%20have%20a%20primarySMTPaddress%20attribute.%20And%2C%20modifying%20the%20default%20rules%20is%20not%20recommended%2C%20so%20you%20should%20create%20a%20separate%20one%20with%20lower%20priority%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fhow-to-connect-sync-change-the-configuration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fhow-to-connect-sync-change-the-configuration%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-545838%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-545838%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20link%2C%20I%20added%20a%20new%20%3CSTRONG%3Einbound%3C%2FSTRONG%3E%20rule%20which%20sets%20the%20UPN%20to%20mail(the%20mail%20attribut%20in%20AD%20is%20set%20to%20the%20primarySMTP%20address%20similar%20to%20the%20cloud%20accounts)%20but%20another%20issue%20occured.%3C%2FP%3E%3CP%3ENow%20test%20users%20are%20syncing%20fine%20and%20with%20the%20wanted%20UPN%20to%20the%20cloud%20tenant%20but%20login%20isn't%20working%20anymore%20to%20any%20cloud%20ressource.%20After%20investigation%20I%20found%20out%20that%20now%20the%20cloud%20UPN%20is%20used%20for%20authentication%20via%20password%20passthrough%20on%20the%20on-premise%20AD.%20This%20works%20as%20expected%20of%20course%20but%20the%20on-premise%20AD%20doesn't%20recognize%20the%20mail%20UPN%20as%20viable%20user%20login.%3C%2FP%3E%3CP%3EI'm%20not%20sure%20what%20I%20need%20to%20do%20that%20the%20cloud%20UPN%20is%20transformed%20back%20to%20the%20AD%20UPN%20while%20login%20data%20checking(if%20this%20is%20possible%20anyways%2C%20I'm%20not%20really%20sure%20how%20the%20login%20data%20is%20processed%20step%20for%20step%20in%20the%20AAD%20Connect%20agent)%20or%20if%20I%20need%20to%20set%20the%20mail%20attribut%20as%20UPN%20during%20AAD%20Connect%20installation%3F%3CBR%20%2F%3EI%20tried%20this%20before%20but%20I%20got%20errors%20saying%20duplicate%20attributes%20were%20populated%20and%20so%20users%20were%20not%20synced.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-548958%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-548958%22%20slang%3D%22en-US%22%3E%3CP%3ESeems%20to%20me%20like%20you%20need%20something%20like%20Alternate%20ID%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fplan-connect-userprincipalname%23alternate-login-id%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fplan-connect-userprincipalname%23alternate-login-id%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt's%20supported%20with%20either%20AD%20FS%20or%20PTA%2C%20however%20in%20both%20cases%20there%20are%20requirements%20on%20the%20clients%2Fknown%20issues%2C%20a%20list%20of%20which%20you%20can%20find%20here%3A%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fidentity%2Fad-fs%2Foperations%2Fconfiguring-alternate-login-id%23applications-and-user-experience-after-the-additional-configuration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fidentity%2Fad-fs%2Foperations%2Fconfiguring-alternate-login-id%23applications-and-user-experience-after-the-additional-configuration%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-569469%22%20slang%3D%22en-US%22%3ERe%3A%20AAD%20Connect%20sync%20local%20mail%20attribut%20as%20cloud%20UPN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-569469%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3Eafter%20several%20days%20of%20testings%20with%20different%20configurations%20I%20get%20this%20to%20work%20with%20configuring%20mail%20as%20UserPrincipalName%20in%20the%20AD%20connect%20wizard%20and%20manually%20creating%20the%20Immutableid%20of%20our%20AD%20users%20and%20adding%20this%20ID%20to%20their%20corresponding%20cloud%20accounts.%3C%2FP%3E%3CP%3EAfter%20this%20procedure%20our%20AD%20users%20are%20hard%20matched%20to%20their%20cloud%20identities%20with%20their%20mail%20as%20primary%20mail%20and%20cloud%20UPN%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20issue%20should%20be%20solved%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20Regards%3C%2FP%3E%3CP%3EJulian%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Aluca12
Occasional Contributor

Hi Everyone,

during installation of Azure AD Connect and synching on-premise user accounts into my cloud tenant and matching these with already existing cloud only accounts, I run into the problem that the on-premise UPN(custom built from name and surname) is set as cloud UPN and not the proxy/mailaddress of my testaccounts.

I simply want that AAD Connect sets the mail or proxyaddress(SMTP:...) attribut as UPN for the matched cloud accounts, which already have their mail address as UPN but after synchronization these correct UPNs are gone.

The cloud domain is set up as upn suffix on-premise and the domain is verified in the tenant.

 

Is there any configuration I can change or adjust e.g. in the rules editor of AAD Connect or somewhere else which solves my problem?

 

I know that I can set the UPN via powershell to the correct one after sync but this can't be the best way to do it.

 

Thanks in advance!

Julian

6 Replies

Why is that a problem, it's the expected behavior. If you want to customize this behavior, you have to play with the default sync rules.

 

Here's the logic used by the rules:

 

IIF(IsPresent([userPrincipalName]),[userPrincipalName], IIF(IsPresent([sAMAccountName]),([sAMAccountName]&"@"&%Domain.FQDN%),Error("AccountName is not present")))

In other words, if the UPN value is populated, it will use that. If the UPN value is not populated, the SamAccountName attribute is used, combined with the @ sign and the domain name.

@Vasil Michev 

Hi Vasil, well, it's a problem because it's annoying to work around atm.

If there is a easy way to accomplish my goal without much effort, then I'll be happy but currently I haven't found anything useful.

As I'm not familiar with these rules I haven't touched them yet.

If I understand you correctly I just need to change in your string the "userPrincipalName" to "mail" at the correct place?

 

Well, for one, "mail" is not the same as the primary SMTP address, and we don't really have a primarySMTPaddress attribute. And, modifying the default rules is not recommended, so you should create a separate one with lower priority: https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sync-change-the-config...

Thanks for the link, I added a new inbound rule which sets the UPN to mail(the mail attribut in AD is set to the primarySMTP address similar to the cloud accounts) but another issue occured.

Now test users are syncing fine and with the wanted UPN to the cloud tenant but login isn't working anymore to any cloud ressource. After investigation I found out that now the cloud UPN is used for authentication via password passthrough on the on-premise AD. This works as expected of course but the on-premise AD doesn't recognize the mail UPN as viable user login.

I'm not sure what I need to do that the cloud UPN is transformed back to the AD UPN while login data checking(if this is possible anyways, I'm not really sure how the login data is processed step for step in the AAD Connect agent) or if I need to set the mail attribut as UPN during AAD Connect installation?
I tried this before but I got errors saying duplicate attributes were populated and so users were not synced.

Seems to me like you need something like Alternate ID: https://docs.microsoft.com/en-us/azure/active-directory/hybrid/plan-connect-userprincipalname#altern...

 

It's supported with either AD FS or PTA, however in both cases there are requirements on the clients/known issues, a list of which you can find here: https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/configuring-alternate-logi...

Hi,

after several days of testings with different configurations I get this to work with configuring mail as UserPrincipalName in the AD connect wizard and manually creating the Immutableid of our AD users and adding this ID to their corresponding cloud accounts.

After this procedure our AD users are hard matched to their cloud identities with their mail as primary mail and cloud UPN :)

 

This issue should be solved now.

 

Kind Regards

Julian

 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
ChirmyRam in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies