Condividi tramite


Support-Tip: (AADCONNECT): How to insert the TargetAddress Attribute Value into the ProxyAddresses list

PRODUCTS INVOLVED

      • Microsoft Azure AD Connect Sync (AADCONNECT)

PROBLEM SCENARIO DESCRIPTION

      • The goal here is to update the proxyAddresses attribute on a User and/or Contact object with the value that is in the targetAddress attribute only if the proxyAddresses attribute does not contain a primary SMTP.  This should only happen for objects that are coming from a specific OU.

RESOLUTION

To achieve this, you will need to create a new Custom Synchronization Rule in Azure AD Connect Sync (Sync Rule Editor).

(e.g. The snapshot below is from my lab that I worked on this solution)

HOW TO STEPS

  • In the Synchronization Rules Editor, click the Add New Rule button in the upper right to add a new Inbound Synchronization Rule
  • DESCRIPTION TAB
    1. Provide the information needed for this Synchronization Rule.  (Example Picture from my lab)
NOTE PRECEDENCE:This refers to Sync Rule Precedence.  The order in which the Sync Rule is executed if in Scope.The key to remember here, is that the lower the Precedence Number, the later in the Synchronization Process it is executed.  The higher the Precedence Number, the earlier in the Synchronization Process it is executed.Basically, if you build this out and you see it not updating, the first thing to check is the Sync Rule Precedence.For more information check this blog:
  • Click the Next button to move to the Scoping Filter tab
    • Click Add Group and then Add Clause
    • Set the Attribute Column to dn
    • Set the Operator Column to Contains
    • Set the Value to the beginning of the OU Distinguished Name (Example Picture is from my lab)
  • Click the Next Button to move to the Join Rules tab
  • No Join Rules needed at this point
  • Click the Next Button to move to the Transformations tab
    1. Click Add Transformation
      1. Flow Type: Expression
      2. Target Attribute: proxyAddresses
      3. Source: IIF(IsNull(ItemOrNull([proxyAddresses],Contains([proxyAddresses],"SMTP:"))),Split(Join([proxyAddresses],";")&";"&[targetAddress],";"), [proxyAddresses])
NOTE JOIN function – takes the proxyAddresses list and turns it in to a delimited string (for example the proxyaddress list becomes:  “smtp:test2@contoso.com;smtp:test@contoso.com”)Then I use the & to concatenate another ; and the targetAddress value (my targetAddress value in my lab is SMTP:TESTNULLMAIL@contoso.com) to this string to become:“smtp:test2@contoso.com;smtp:test@contoso.com;SMTP:TESTNULLMAIL@contoso.com;”Then the Split function – splits this string (the new string with the added targetAddress value) back into separate values for the proxyAddress list

 

NOTE    
  • Click the Save Button

TESTING RESULTS

We can see at the initial Import of the Object, that we do not have the targetAddress value in the proxyAddresses attribute.

  • Do a Generate Preview to confirm success in Sync.
  • Then Commit the Preview.
NOTE It is best to commit the preview and review the actual metavaerse object.  The reason for this, is that Preview has an issue to where you may see duplicates when reviewing the Previewed Object.  However, reviewing the actual Metaverse Object will display the correct results.

Review of the Metaverse Object Properties (after the Commit or after the sync of the object)

ADDITIONAL INFORMATION