Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Create Account in Active Directory Failing with error

Prajna
New Contributor
New Contributor

Hi Team,

We have configured create account json for provisioning accounts in AD. But while trying to execute the create user task it fails with an error. The error screenshot and logs is attached for your reference.  Please find the create account json mentioned below. The create user json is working if we remove proxy address and title attribute from the json. Please provide input on this issue.

{
"c": "${if(user.country=='Australia'){'AU'} else{''}}",
"cn": "${user.username}",
"co": "${user.country}",
"countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
"company": "${user.companyname}",
"department": "${user.customproperty38}",
"departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"description": "${'Provisioned by IAM'+ user.startdate}",
"displayname": "${if(user.displayname!=null) {user.dislayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
"employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
"extensionAttribute10": "${user.locationdesc}",
"extensionAttribute11": "${user.departmentname}",
"extensionAttribute12": "${user.customproperty9}",
"extensionAttribute13": "${user.customproperty35}",
"extensionAttribute5": "${user.customproperty44}",
"extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
"extensionAttribute8": "${user.companyname}",
"givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
"homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
"homeDrive": "I:",
"info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"l": "${user.locationdesc}",
"mail": "${user.email}",
"manager": "${managerAccount.customproperty23}",
"name": "${user.username}",
"physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
"postalAddress": "${user.customproperty3}",
"postalCode": "${user.regioncode}",
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'}} else {user.customproperty54}}}}}",
"proxyAddresses:"${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
"sAMAccountName": "${user.username}",
"seeAlso": "${user.customproperty44}",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"userAccountControl": "512",
"userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
"employeeID": "${user.username}",
"pwdLastSet": "0",
"division": "${user.departmentNumber}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
]
}

 

 

22 REPLIES 22

ARNAB86
New Contributor III
New Contributor III

Any suggestion most welcome

rushikeshvartak
All-Star
All-Star
{
  "c": "${if(user.country=='Australia'){'AU'} else{''}}",
  "cn": "${user.username}",
  "co": "${user.country}",
  "countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
  "company": "${user.companyname}",
  "department": "${user.customproperty38}",
  "departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
  "description": "${'Provisioned by IAM'+ user.startdate}",
  "displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
  "employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
  "extensionAttribute10": "${user.locationdesc}",
  "extensionAttribute11": "${user.departmentname}",
  "extensionAttribute12": "${user.customproperty9}",
  "extensionAttribute13": "${user.customproperty35}",
  "extensionAttribute5": "${user.customproperty44}",
  "extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
  "extensionAttribute8": "${user.companyname}",
  "givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
  "homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
  "homeDrive": "I:",
  "info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
  "l": "${user.locationdesc}",
  "mail": "${user.email}",
  "manager": "${managerAccount.customproperty23}",
  "name": "${user.username}",
  "physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
  "postalAddress": "${user.customproperty3}",
  "postalCode": "${user.regioncode}",
  "title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ (user.customproperty25=='ZOL' ? '(On-Loan)' : (user.customproperty25=='ZRO' ? '(Rotation)' : (user.customproperty25=='ZSE' ? '(Secondment)' : (user.customproperty25=='ZAF' ? '(Acting For)' : user.customproperty54))))}}",
  "proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
  "sAMAccountName": "${user.username}",
  "seeAlso": "${user.customproperty44}",
  "sn": "${user.lastname}",
  "st": "${user.state}",
  "streetAddress": "${user.street}",
  "userAccountControl": "512",
  "userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
  "employeeID": "${user.username}",
  "pwdLastSet": "0",
  "division": "${user.departmentNumber}",
  "objectClass": [
    "top",
    "person",
    "organizationalPerson",
    "user"
  ]
}

I fixed a couple of typos in the code, like 'dislayname' instead of 'displayname', and corrected the syntax in the 'title' field. Please review and use this corrected JSON structure.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh,

We are now getting the error in proxy attribute. Please find the error screenshot and the logs for the same. Kindly provide suggestion.

Warm Regards,

Prajna Paramita Mahapatro

{
  "c": "${if(user.country=='Australia'){'AU'} else{''}}",
  "cn": "${user.username}",
  "co": "${user.country}",
  "countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
  "company": "${user.companyname}",
  "department": "${user.customproperty38}",
  "departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
  "description": "${'Provisioned by IAM'+ user.startdate}",
  "displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
  "employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
  "extensionAttribute10": "${user.locationdesc}",
  "extensionAttribute11": "${user.departmentname}",
  "extensionAttribute12": "${user.customproperty9}",
  "extensionAttribute13": "${user.customproperty35}",
  "extensionAttribute5": "${user.customproperty44}",
  "extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
  "extensionAttribute8": "${user.companyname}",
  "givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
  "homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
  "homeDrive": "I:",
  "info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
  "l": "${user.locationdesc}",
  "mail": "${user.email}",
  "manager": "${managerAccount.customproperty23}",
  "name": "${user.username}",
  "physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
  "postalAddress": "${user.customproperty3}",
  "postalCode": "${user.regioncode}",
  "title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ (user.customproperty25=='ZOL' ? '(On-Loan)' : (user.customproperty25=='ZRO' ? '(Rotation)' : (user.customproperty25=='ZSE' ? '(Secondment)' : (user.customproperty25=='ZAF' ? '(Acting For)' : user.customproperty54))))}}",
  "proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
  "sAMAccountName": "${user.username}",
  "seeAlso": "${user.customproperty44}",
  "sn": "${user.lastname}",
  "st": "${user.state}",
  "streetAddress": "${user.street}",
  "userAccountControl": "512",
  "userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
  "employeeID": "${user.username}",
  "pwdLastSet": "0",
  "division": "${user.departmentNumber}",
  "objectClass": [
    "top",
    "person",
    "organizationalPerson",
    "user"
  ]
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh,

We have used the proxy addresses attribute as per your suggestion.

"proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",

 But still we are receiving the error that is highlighted in the above mail. 

Hi Rushikesh

Thanks for the reply,

Actually we want liitle bit changes in the code 

ARNAB86_0-1706080685269.png

the user.custompropert54 should be in else condition not as or condition..

Can you please help on this

 

Hi @ARNAB86 

Replace this line:

"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'}} else {user.customproperty54}}}}}",

With this modified line:

"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'} else {user.customproperty54}}}} else {''}}}",

Please validate.

We have modified the json as per your suggestion. But we are still receiving below error

"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: SimpleTemplateScript36.groovy: 31: expecting '}', found '+' @ line 31, column 103. !=null) {user.customproperty54+ if(user. ^ 1 error"

Share latest json


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh

Please find the json

"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'} else {user.customproperty54}}}} else {''}}}",

{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi rushikesh,

The below code as suggested throwing error in json validator

{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}

 

error

Error: Parse error on line 2:
{"title": "${(user.customprope
----------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

can you please suggest

DixshantValecha
Saviynt Employee
Saviynt Employee

Hi @Prajna,

We are checking on your request and we will keep you posted.

DixshantValecha
Saviynt Employee
Saviynt Employee

It seems there are a couple of issues in your JSON configuration. Let's address them:

1. **Typo in the JSON structure:**
There is a typo in the "proxyAddresses" attribute. It should not have a colon after the attribute name. It should be a colon instead. Here's the corrected line:

```json
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
```

2. **Typo in the attribute name:**
There is a typo in the "displayname" attribute. You have written "dislayname" instead of "displayname". Here's the corrected line:

```json
"displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
```

After making these corrections, your JSON should work better. If the issue persists or if there are additional errors, you may want to review the error messages or logs for more details on what went wrong during the execution.

Hi Team,

We have used this code but still getting the error

Thanks

Arnab Pal

"proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",

 

Hi Thanks for the update but getting error still in the proxyaddress which you have suggested

"proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",

 

Please share error logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh,

Please find the error logs and the error screenshot for create user json. The error is in proxy address attribute.

 

title issue solved ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh 

no the code below it’s throwing error in json validator

{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}

 

 

and also getting error for below proxy address as well

proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",

ARNAB86
New Contributor III
New Contributor III

Please help on this