Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/27/2024 01:53 AM
We are trying to set accountexpires attribute in AD with enddate of user. If enddate of user is 19th feb then it should expire at the end of the 19th feb i.e., 19-02-2024 11:59:00. But in our case it is setting accountexpires as 19-02-1024 00:00:00 and will expire account on the start of 19th feb and not on end of 19th.
Please find our configuration JSON below:
attrs.put('accountExpires', user.enddate==null?'9223372036854775807':(10000*(user.enddate.getTime() + 11644473600000)));
i also tried by adding 2359 in offset value as below but it didn't worked and still showing accountexpires as 19-02-2024 00:00:00
attrs.put('accountExpires', user.enddate==null?'9223372036854775807':(10000*(user.enddate.getTime() + 11644473600000 + 2359)).toString());
Solved! Go to Solution.
02/27/2024 02:52 AM
Hi @manish97sh
Did you try hardcoding the value and see if its working?
133528607400000000
02/27/2024 03:23 AM - edited 02/27/2024 03:32 AM
Hi @naveenss ,
i used below query with your changes but now it is showing account expires as Apr 08, 2078 23:59:00. End date of user is 19th feb and not 8th april.
attrs.put('accountExpires', user.enddate==null?'9223372036854775807':(10000*(user.enddate.getTime() + 13352860740000)).toString());
Also your value was giving data truncation error so i truncate it with new value as 13352860740000
02/27/2024 03:45 AM
@manish97sh may I know what is the user's end date here? Is it Feb 19th 2024 stored as 2024-02-19 00:00:00 in the Saviynt DB?
02/27/2024 03:48 AM
@naveenss YES
02/27/2024 04:01 AM
@manish97sh try below
attrs.put('accountExpires', user.enddate==null?'9223372036854775807':(10000*(user.enddate.getTime() + 11644473600000 +86340000)).toString());
02/27/2024 06:31 AM
@naveenss It worked with above query. Thanks!!
04/03/2024 12:43 PM
Hi @manish97sh
Can you share the whole JSON, I am facing date conversion issue as I am passing CP49 value to account expires and its giving me error as CP49 is text and conversion not working. So want to know how attrs.put is used, may be I can try this in UpdateAccountJSON if I get sample.
Thank you
Mahesh