Converting Date into LDAP Timestamp

Hello,

I am currently using UiPath to create AD accounts and I need to set the ‘accountExpires’ attribute when creating the account. I noticed the attribute uses the LDAP timestamp format (132382728000000000 = 07/03/2020 1:00:00pm central). I was wondering how I can convert a human readable date (ie: 2020-07-03) into the value I will need to supply for this attribute.

Thanks!

2 Likes

This will be the format needed (in this case would be a 30 days expire):
DateTime.UtcNow.AddDays(30).ToFileTime()

1 Like

Worked! Thank you :slight_smile:.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.