I am calculating the UPN for a active directory account provisioning using a attribute generator rule and want to use the first part of the calculated UPN for the cn and the samAccountName. I am trying a transform as below:
When you say it “doesn’t work”, what specifically isn’t working? What is your expected result, and what is the actual result. This will help us narrow down the issue.
I was expecting a proper dn to be returned with the first part of the userPrincipalName, it works if I just say cn=$userPrincipalName but we dont want the full upn in the dn.
I have two suggestions that you can try. Looking at your transform, the input to the split is outside of the attributes object it needs to be in. See below.
What I am not sure about is where the $userPrincipalName is coming from. If it is an another identityAttribute you can use it as an identityAttribute input. See example below:
Thanks for that Tyler, I am now getting a null pointer exception.
I am trying to use a previously generated userPrincipalName in the create profile using a attribute generator rule with the $userPrincipalName value. It works if used standalone as a static value. But the transform to take the first part is now giving me a null pointer exception. Even when I use a hard static value it is giving me a null pointer exception.
I haven’t tested this myself, but could the delimiter be the culprit? I don’t think you need to escape the @ symbol. Have you tried "delimiter": "@", ?
I am reverting back to a rule, but using a rule how can I pass a previous attribute from the Create Profile in the template to the rule. I have tried the $userPrincipalName, but it takes it as a literal value. I want to be able to reuse the first part of the UPN that has been generated for the sAMAccountName and the CN.