Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

Populate preferedDataLocation thru Ad Connect based on C, CO, or Country Code attributes?

Microsoft

Hey all,

 

Is it possible to use a transformation rule in AD Connect to use the C, CO, or Country Code field to populate the preferredDatalocation (PDL) attribute?   I know you can use expressions in the transformation field, but not sure how to transform these attributes (2 letters or #code) into the 3 letter country code required for the PDL.   Yes ideally it should be filled out at account creation or provisioning, but can this be done on the backend with an AD Connect rule?   

4 Replies

You can simply use the msDS-preferredDataLocation attribute, or follow the same procedure to configure a custom one: https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sync-feature-preferred...

Thanks Vasil,   I tired to convince them this was the right way to do it, but they do not populate this when accounts are provisioned, so they would like a rule to to look at another attribute (C, CO, Country Code) and transform that value into the correct 3 letter code for PDL.   I feel doing it at account creation is the way to go, but it seems we should be able to use an expression to change a value and populate the PDL.   

Same principle applies, you just need to adjust the "transform" part of the rules detailed in the article.

@Vasil Michev That's exactly what I am trying to figure out :)   It would be much easier in PowerShell, but trying to figure out the expression language to look at the attribute and transform it to one of 6 or 7 different possible codes is where I am getting stuck.   :)