cancel
Showing results for 
Search instead for 
Did you mean: 

Correct way to set AD accountExpires to follow MX_VALIDTO

Former Member
0 Kudos

Hi

have anyone provisioned AD accountExpires attribute of Active Directory from IDM.

accountExpires contain date on format 100 nanosecond intervals since January 1, 1601.

Reason I ask is tha does anyone have a ready javascipt to convert MX_VALIDTO to AD accountExpires format?

BR

Veli-Matti

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Windows uses a FileTime (nanosecond since 1/1/1601).

So convert the current date string to a java time (milliseconds since 1/1/1970) and then something like:

(jsTimePeriod * 100000) + 116444736000000000;

116444736000000000 is the difference in nanoseconds between 1601 and 1970.

That should set the expiry date correctly.  You might also want to check for 31/12/9999 and set the AD time to 0 (never expires)

Peter