09/22/2023 10:59 AM
Hi team,
We have use case to reset the password for rehire case while enabling the account. We have tried with the below JSONs but no luck.
Enable Account JSOn:
{
"USEDNFROMACCOUNT": "YES",
"MOVEDN": "YES",
"REMOVEGROUPS": "NO",
"ENABLEACCOUNTOU": "${if(user.employeeType!=null){if((user.employeeType.equals('Employee')) || (user.employeeType.equals('Non US Employee'))){ 'OU=Savi_Employee,OU=Saviynt_Test,OU=RSG,DC=rsgcorp,DC=local'}else if ((user.employeeType.equals('Contractor')) ||(user.employeeType.equals('Agency/Temp')) || (user.employeeType.equals('Intern')) ||(user.employeeType.equals('Non US Contractor')) ||(user.employeeType.equals('Non US Intern')) ||(user.employeeType.equals('Non US Agency/Temp'))) { 'OU=Savi_Contractor,OU=Saviynt_Test,OU=RSG,DC=rsgcorp,DC=local'}} else {'OU=Saviynt_Test,OU=RSG,DC=rsgcorp,DC=local'}}",
"msExchHideFromAddressLists": "FALSE",
"AFTERMOVEACTIONS": {
"userAccountControl": "512",
"password": "${if(user.customproperty65.equals('1') && user.customproperty47.equals('Rehire')){\"userPassword\":\"randomPassword\"} else {\"useraccountcontrol\":\"512\"}}",
"description": ""
}
}
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"}
Regards,
Rajesh
Use == or equalsIgnoreCase
}
09/25/2023 08:23 AM
Hi @rajeshg
Can you let me know if you have used directly instead of if else condition there , just pass password as random password and try it out.
Thanks
Darshan
09/26/2023 08:14 AM
Hi @Darshanjain ,
Thanks for your response.
Our case is not to reset the password for users who are retrun from the leave. Password change is only for Rehire case.
Regards,
Rajesh
09/26/2023 09:20 PM
Hi @rajeshg
I agree but i wanted to understand it worked or not, now if you dont want to test it out then you can check the logs to see what it is trying to pass while enabling and see password is being updated or not.
Thanks
Darshan