In the above example, I’ve set an identity attribute that maps the DN from the Active Directory source for a given identity, called " Active Directory DN (activeDirectoryDn)". Now for any identity, I want to refer to the identity attribute of the manager. That’s where the getReferenceIdentityAttribute comes in. You can use this to reference any identity attribute of a manger.
By using an identity attribute, you can map this down to the Active Directory create account profile and use attribute sync. If you put a rule or transform directly in the create account profile, then you can’t use attribute sync to keep it up to date after changes occur.
@amithkumar1 I don’t think getAccountByDisplayName() is the right choice here since your servicenowManager attribute contains the manager’s sAMAccountName, not the AD display name.
If it were me, I’d first try to find the corresponding Identity using that value and then retrieve the manager’s Active Directory account to get the distinguishedName. That feels like a more reliable approach than trying to match on the display name.
Hello AMithkumar. @MattUribegetReferenceIdentityAttribute suggestion is probably the cleanest path here. If the manager relationship is already resolved in ISC through manager correlation, the approach is to map the AD distinguishedName to an identity attribute (say activeDirectoryDn), then use the Get Reference Identity Attribute transform:
If this is mapped to the AD manager attribute in your provisioning policy and attribute sync is configured, manager changes can be synchronized automatically.
To your first question, getAccountByDisplayName() is not the right fit here. It matches against the ISC account display name (the Account Name field in your source schema), not an arbitrary AD attribute like sAMAccountName. So passing CED123 would not return the correct account unless that field happens to be mapped to sAMAccountName.
If the ISC manager relationship is not available, there is no getAccountBySamAccountName() method in IdnRuleUtil. The supported approach would be to promote AD sAMAccountName as a searchable account attribute and run a non-optimized aggregation to seed existing accounts. Then in your rule, use idn.attrSearchGetIdentityName() to resolve the owning identity, and idn.getFirstAccountNativeIdentity("Active Directory", identityName) to get the DN directly (since AD’s native identity is the distinguishedName).
I would suggest trying the transform approach first since it avoids custom account lookup logic entirely and is easier to maintain long term.
Hi @amithkumar1 , If I’m reading your first question correctly, you’re all set — here’s my understanding of the flow:
You’re pulling the serviceNowManager identity attribute, which holds the manager’s sAMAccountName.
You’re then using that sAMAccountName to look up the manager’s account in your AD source via getAccountByDisplayName(), in order to retrieve their DN.
The key thing to note is that getAccountByDisplayName() doesn’t actually search on the literal “Display Name” account attribute — it searches on whatever attribute is configured as Account Name in that source’s Account Schema, which in your case is sAMAccountName.
Since the OOTB AD connector maps Account Name to sAMAccountName by default, the function is effectively looking up the manager’s sAMAccountName in the AD source and returning the corresponding DN.