Hello,
I am currently working on a workflow that will detect identities whose OU in Active Directory is not the same as the manager they report to, and creates a ticket for IAM to remediate. I am using the attribute AD DistinguishedName and comparing them to the managers AD Distinguished Name. The attribute is a string, but is comprised of a CN and 2-3 OU’s following the CN, please see attached image below.
The CN will always be the identity’s display name, so comparing them in the workflow will always result in the attribute not matching. My plan was to use the Define Variable step in the workflow, and use a Substring Transform within that define variable step that just removes every character before the first OU. The starting point for the substring transform needs to be dynamic in order to account for CN’s being different lengths every time due to different display names, so I used $.getIdentity.attributes.displayName.length() to be the starting point for the substring. My issue is that I need more than just the displayName length, I need an additional 4 characters on top of displayName length to account for “CN=” and the comma after the CN value. Does anyone know of a way to add 4 to the display name length or another workaround for this problem?
If I can’t utilize the substring transform, my next option was the replace transform and try to use regex to remove everything before the first comma, but I feel like this can be done with the substring transform. Any help is appreciated, thank you!
