Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Error in my createaccountjson for Active Directory

aundreb
Regular Contributor II
Regular Contributor II

Hello,

I'm getting the below error when trying to provision an AD account. I've used a similar json for another connector but seem to be getting this error with slight modification for checking if the attribute is equal to null. My json is posted below. Any suggestions?

aundreb_0-1672934187020.png

{
"sAMAccountName": "t${user?.username == null ? '' : user?.username}",
"displayName": "${user?.displayname == null ? '' : user?.displayname}",
"mail": "${user?.email == null ? '' : user?.email}",
"employeeid": "${user?.employeeid == null ? '' : user?.employeeid}",
"CannotChangePassword": "",
"l": "${user?.city == null ? '' : user?.city}",
"scriptPath": "default.bat",
"givenName": "${user?.firstname == null ? '' : user?.firstname}",
"sn": "${user?.lastname == null ? '' : user?.lastname}",
"objectclass": [
"top",
"person",
"organizationalPerson",
"user"
],
"userPrincipalName": "t${user?.systemUserName == null ? '' : user?.systemUserName}@test.com",
"company": "Test",
"description": "${user?.displayname == null ? '' : user?.displayname}",
"pwdLastSet": "0",
"department": "${user?.departmentname == null ? '' : user?.departmentname}",
"title": "${user?.title == null ? '' : user?.title}",
"homePhone": "${user?.phonenumber == null ? '' : user?.phonenumber}",
"streetAdress": "${user?.street == null ? '' : user?.street}",
"st": "${user?.street == null ? '' : user?.street}",
"postalcode": "${user?.regioncode == null ? '': user?.regioncode}",
"extensionAttribute1": "${user?.customproperty14 == null ? '' : user?.customproperty14}",
"extensionAttribute2": "${user?.customproperty15 == null ? '' : user?.customproperty15}",
"exofficelocation": "${user?.location == null ? '' : user?.location}",
"pager": "${user?.customproperty61 == null ? '' : user?.customproperty61}",
"userPassword": " ${randomPassword}",
"accountExpires": "0",
"userAccountControl": "66048",
"manager": "${managerAccount?.accountID == null ? '' : managerAccount?.accountID}"
}

8 REPLIES 8

sk
All-Star
All-Star

Is there any reason why you are doing null check for almost all attributes? Did you face any issue in creating account without null check ?

Also can you try modifying manager mapping as below?

"manager": "${managerAccount==null?null:managerAccount.accountID}"

if it still didn't work and you need to do null check on all attributes then change your null check as below

Ex: "displayName": "${user.displayname==null?null:user.displayname}"

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

aundreb
Regular Contributor II
Regular Contributor II

No reason, I was checking as I kept getting the same error message without the null check.

I tried your modification below and still getting the same error. Below is the modified JSON.

 

{
"sAMAccountName": "t${user?.username==null?null:user?.username}",
"displayName": "${user?.displayname==null?null:user?.displayname}",
"mail": "${user?.email}",
"employeeid": "${user?.employeeid}",
"CannotChangePassword": "",
"l": "${user?.city}",
"scriptPath": "default.bat",
"givenName": "${user?.firstname==null?null:user?.firstname}",
"sn": "${user?.lastname==null?null:user?.lastname}",
"objectclass": [
"top",
"person",
"organizationalPerson",
"user"
],
"userPrincipalName": "t${user?.systemUserName==null?null:user?.systemUserName}@test.com",
"company": "Test",
"description": "${user?.displayname}",
"pwdLastSet": "0",
"department": "${user?.departmentname}",
"title": "${user?.title}",
"homePhone": "${user?.phonenumber}",
"streetAdress": "${user?.street}",
"st": "${user?.street}",
"postalcode": "${user?.regioncode}",
"extensionAttribute1": "${user?.customproperty14}",
"extensionAttribute2": "${user?.customproperty15}",
"exofficelocation": "${user?.location}",
"pager": "${user?.customproperty61}",
"userPassword": " ${randomPassword}",
"accountExpires": "0",
"userAccountControl": "66048",
"manager": "${managerAccount==null?null: managerAccount.accountID}"
}

I m not sure if it is typo error while pasting in forum or same you have used in connector. Can you make sure that you have don't have "t" in samaccountname mapping ? If you have then try to remove it and try again?

"sAMAccountName": "t${user?.username==null?null:user?.username}",
  • If it still fails then can you confirm whether you are creating regular account vs service account?
  • Also you mentioned in another connection same JSON is working, Does the target for both connections is same? I mean AD domain is same in both connections?

Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

aundreb
Regular Contributor II
Regular Contributor II

I'll need the t in there as my client adds a t to the start of an admin account, which I'm trying to test provisioning for. Is the way I am doing the t a syntax error?

The AD domain for both connections is the same but the other is for regular accounts and not admin accounts.

Then try like below

"sAMAccountName": "${'t'+ (user?.username==null?null:user?.username)}",

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

aundreb
Regular Contributor II
Regular Contributor II

Tried your suggestion but still seem to be getting the same error as above. See below json. Not sure what the cause is.

 

{
	"sAMAccountName": "${'t' + (user?.username==null?null:user?.username)}",
	"displayName": "${user?.displayname==null?null:user?.displayname}",
	"mail": "${user?.email}",
	"employeeid": "${user?.employeeid}",
	"CannotChangePassword": "",
	"l": "${user?.city}",
	"scriptPath": "default.bat",
	"givenName": "${user?.firstname==null?null:user?.firstname}",
	"sn": "${user?.lastname==null?null:user?.lastname}",
	"objectclass": [
		"top",
		"person",
		"organizationalPerson",
		"user"
	],
	"userPrincipalName": "${'t' + (user?.systemUserName==null?null:user?.systemUserName) + '@test.com'}",
	"company": "Test",
	"description": "${user?.displayname}",
	"pwdLastSet": "0",
	"department": "${user?.departmentname}",
	"title": "${user?.title}",
	"homePhone": "${user?.phonenumber}",
	"streetAdress": "${user?.street}",
	"st": "${user?.street}",
	"postalcode": "${user?.regioncode}",
	"extensionAttribute1": "${user?.customproperty14}",
	"extensionAttribute2": "${user?.customproperty15}",
	"exofficelocation": "${user?.location}",
	"pager": "${user?.customproperty61}",
	"userPassword": "${randomPassword}",
	"accountExpires": "0",
	"userAccountControl": "66048",
	"manager": "${managerAccount==null?null: managerAccount.accountID}"
}

 

Try similar json with few mandatory attributes 


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

Try below JSON, I see that for streetAddress you have used wrong parameter I changed that and also removed some of the field mappings. If below works you can add one by one to see which one is causing issue.

{
"sAMAccountName": "${'t' + (user?.username==null?' ':user?.username)}",
"displayName": "${user?.displayname==null?null:user?.displayname}",
"mail": "${user?.email}",
"employeeID": "${user?.employeeid}",
"l": "${user?.city}",
"givenName": "${user?.firstname==null?null:user?.firstname}",
"sn": "${user?.lastname==null?null:user?.lastname}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
],
"userPrincipalName": "${'t' + (user?.systemUserName==null?null:user?.systemUserName) + '@test.com'}",
"pwdLastSet": "0",
"department": "${user?.departmentname}",
"title": "${user?.title}",
"homePhone": "${user?.phonenumber}",
"streetAddress": "${user?.street}",
"st": "${user?.street}",
"postalCode": "${user?.regioncode}",
"extensionAttribute1": "${user?.customproperty14}",
"extensionAttribute2": "${user?.customproperty15}",
"pager": "${user?.customproperty61}",
"userPassword": "${randomPassword}",
"accountExpires": "0",
"userAccountControl": "66048",
"manager": "${managerAccount==null?null: managerAccount.accountID}"
}

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.