Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/30/2022 03:51 AM
Hello,
We had opened a ticket about this issue - ||1403025|| AD Job not running in dev - and they directed us here. So, it turns out that a particular code we had written for ad remove account action is not working. We were told that a keyword is now obsolete and not supported by saviynt. The code is:
if((new java.text.SimpleDateFormat('dd-MMM-yyyy').parse(new java.text.SimpleDateFormat('dd-MMM-yyyy').format(new Date())).getTime()-new java.text.SimpleDateFormat('dd-MMM-yyyy').parse(new java.text.SimpleDateFormat('dd-MMM-yyyy').format(user.termDate)).getTime())/(1000*60*60 * 24)>=30)
We were told to ask on forum for help regarding this code. What we're trying to do is put the accounts in a particular terminated ou until after thirty days of their termination. After thirty days they should be automatically deleted. Can someone tell us what the wrong keyword is and how to fix it?
Thank you
05/30/2022 09:10 AM
Hi Seemran17
Which version are you using ?
Can you please paste the logs here.
Are you able to check the Remove account Json once?
Thanks
Shyam
05/30/2022 09:20 AM
Hello,
The version is Saviynt v2020.0. We cant retrieve logs now since the workaround has been in place a long time.
As for remove account action code, it was testing fine and connection successful but in the ticket we were told that a keyword was not supported by this version.
The whole code is this:
${
Map map1 = new HashMap();
if((new java.text.SimpleDateFormat("dd-MMM-yyyy").parse(new java.text.SimpleDateFormat("dd-MMM-yyyy").format(new Date())).getTime()-new java.text.SimpleDateFormat("dd-MMM-yyyy").parse(new java.text.SimpleDateFormat("dd-MMM-yyyy").format(user.termDate)).getTime())/(1000*60*60 * 24)>=30)
map1.put("removeAction","DELETE");
else{
map1.put("removeAction","SUSPEND");
map1.put("moveUsertoOU","OU=Terminated,OU=Process,DC=GBT,DC=GBTAD,DC=COM");
map1.put("deleteAllGroups","No");
map1.put("userAccountControl","514");
if(user.termDate != null)
map1.put("description","Terminated by AccessIT on "+ user.termDate);
else
map1.put("description","Terminated by AccessIT on "+ user.updatedate);
}
jsonBuilder = new groovy.json.JsonBuilder(map1);
return jsonBuilder.toString();
}
but issue is only in the part of the code i'd attached earlier. Please let me know if any other details required
Thanks