and more in a single search tool across platforms. Read the announcement here. |
08/16/2022 09:48 AM
We have a requirement where we want to reset user account password while enabling and disabling account only when user is rehired or terminated.
But whenever user is on leave or return from leave we only want to enable or disable the account. No password reset should be done.
I am using the below JSON for enabling and Disabling account. It's not working as expected.
enable account JSON
{
"USEDNFROMACCOUNT": "YES",
"MOVEDN": "YES",
"ENABLEACCOUNTOU": "XXXX",
"REMOVEGROUPS": "NO",
"AFTERMOVEACTIONS": {"{${if(user?.customproperty4='Active'){\"userPassword\":\"randomPassword\"} else {\"useraccountcontrol\":\"512\"}}}",
"pwdLastSet": "0"}
}
Disable account JSON
{"deleteAllGroups":"No","moveUsertoOU":"XXXXX","userAccountControl":"514",
"AFTERMOVEACTIONS": {"{${if(user?.customproperty4='Terminated'){\"Password\":\"randomPassword\"} else {\"useraccountcontrol\":\"514\"}}}",
"pwdLastSet": "-1"}
}
I am getting the below error for the above JSON:
2022-08-16 16:41:04,458 [quartzScheduler_Worker-4] DEBUG println.PrintlnToLogger - Println :: [1;31m| Error [22;39mgroovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
SimpleTemplateScript13775.groovy: 2: unexpected char: '\' @ line 2, column 68.
customproperty4='Terminated'){\"Password
10/25/2022 08:35 PM
enable account JSON
{
"USEDNFROMACCOUNT": "YES",
"MOVEDN": "YES",
"ENABLEACCOUNTOU": "XXXX",
"REMOVEGROUPS": "NO",
"AFTERMOVEACTIONS": {"{${if(user?.customproperty4=='Active'){\"userPassword\":\"randomPassword\"} else {\"useraccountcontrol\":\"512\"}}}",
"pwdLastSet": "0"}
}
Disable account JSON
{"deleteAllGroups":"No","moveUsertoOU":"XXXXX","userAccountControl":"514",
"AFTERMOVEACTIONS": {"{${if(user?.customproperty4=='Terminated'){\"Password\":\"randomPassword\"} else {\"useraccountcontrol\":\"514\"}}}",
"pwdLastSet": "-1"}
Use == or equalsIgnoreCase
}