Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/21/2023 04:04 AM - edited 09/21/2023 04:07 AM
I am trying to provision AD account and in the accountnamerule , I am passing as below:
'CN='+user.displayname+',OU=External%20Accounts,OU=Corp%20OUs,DC=test,DC=com'
The provisioning is successful but the displayname has comma in it. Displayname is in the format: firstname,lastname. I tried to escape it by using the replace function( {'CN='+user.displayname.replace(',','%2C')+',OU=External%20Accounts,OU=Corp%20OUs,DC=test,DC=com'), but it didnt work.
I also tried passing \\, in the replace function as below,
'CN='+user.displayname.replace(',','\\,')+',OU=External%20Accounts,OU=Corp%20OUs,DC=test,DC=com'}
I am getting the replaced values in the DN (example: firstname%2Clastname or firstname\\,lastname)
Instead I want to return just 'firstname, lastname'.
Could you please help me resolve this issue ?
09/25/2023 01:23 PM
Just to confirm, you do want the comma to be included in the displayname value being sent from Saviynt. If so, can you try with .replace(',','\,') or .replace(',','\\\,')
09/26/2023 04:37 AM
I tried both the options you mentioned and still facing the issue .
here's the error with .replace(',','\,')
Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript5.groovy: 1: unexpected char: '\' @ line 1, column 98. user.displayname.replace(',','\,')+',OU= ^ 1 error
here's the error with .replace(',','\\\,')
Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript4.groovy: 1: unexpected char: '\' @ line 1, column 100. er.displayname.replace(',','\\\,')+',OU= ^ 1
The account name rule configured is:
${if(user.employeeType.equals('Contractor')){'CN='+user.displayname.replace(',','\\\,')+',OU=contractors,OU=Contractor%20OUs,OU=***,DC=***,DC=com'}else if(user.customproperty32.substring(0,2).toString().equals('ext')){'CN='+user.displayname.replace(',','\\\,')+'OU=Externalusers,OU='+user.customproperty31+',OU='+user.customproperty32+',OU=***,DC=***,DC=com'}else{'CN='+user.displayname.replace(',','\\\,')+',OU=Users,OU='+user.customproperty31+',OU='+user.customproperty32+',OU=***,DC=***,DC=com'}}
09/26/2023 08:39 AM
In case this is not working and since your display name value is firstname,lastname; can you use the below instead
{'CN='user?.firstname+','+user?.lastname+',OU=')
09/27/2023 03:56 AM
Hi Sahil ,
I wont be able to use the solution you provided because the displayname is a combination of 4 attributes : Preferred firstname, Firstname, Lastname prefix and lastname.