Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

AD Account creation Issue: DN

sp
New Contributor
New Contributor

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 ? 

 

4 REPLIES 4

SB
Saviynt Employee
Saviynt Employee

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(',','\\\,')


Regards,
Sahil

sp
New Contributor
New Contributor

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'}}

SB
Saviynt Employee
Saviynt Employee

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=')


Regards,
Sahil

sp
New Contributor
New Contributor

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.