Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

accountexpires attribute not setting correct timestamp in AD

manish97sh
New Contributor III
New Contributor III

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());

7 REPLIES 7

naveenss
All-Star
All-Star

Hi @manish97sh 

Did you try hardcoding the value and see if its working?

133528607400000000

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

manish97sh
New Contributor III
New Contributor III

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

@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?

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

manish97sh
New Contributor III
New Contributor III

@naveenss  YES

@manish97sh  try below

attrs.put('accountExpires', user.enddate==null?'9223372036854775807':(10000*(user.enddate.getTime() + 11644473600000 +86340000)).toString());

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

manish97sh
New Contributor III
New Contributor III

@naveenss It worked with above query. Thanks!!

mbh_it
Regular Contributor II
Regular Contributor II

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