I recently had a request to get the AD user accounts expiring in 30 days from today's date, using Nintex Workflow.
An AD timestamp (AKA LDAP time, WinTime or FileTime) is the number of 100-nanoseconds since the year 01/01/1601 @ 00:00.
There's a number of online tools that help us calculating this. For example,
we can use silisoftware online free tool
So, 130960980000000000 is the number of 100-nanoseconds between 01/01/1601 @ 00:00 and 01/01/2016 @ 00:00, and it's also the AD timestamp for 01/01/2016 @ 00:00
Nintex allows us to get the number of seconds since 01/01/1900 @ 00:00, so we will have to do 3 steps to get the number of 100-nanoseconds since 01/01/1601 @ 00:00:
Number of Seconds since 00:00:00 1/1/1900
2. Multiply var_secsSinceJanFirst1900 by 10^7 (100-nanosecs), save result in var_100nanoSecsSinceJanFirst1900
3. Add the number of 100-nanoseconds between 01/01/1601 @ 00:00 and 01/01/1900 @ 00:00, to varNum_100nanoSecsSinceJanFirst1900, save result in varNum_requiredDateinADTimeStampFormat.
The calculations combined are as follows:
varNum_requiredDateinADTimeStampFormat = (varNum_secsSinceJanFirst1900 * 10^7) + 94354848000000000
2. To convert the AD timestamp produced from the calculations, to a text readable by AD:
The result of the calculations done above, is something like this: 1.3086031037335E+17, if you pass the number in this format to AD, AD won't recognize the number as an AD timestamp, and you will get zero result.
An AD timestamp is an 18 digit number, so we need to convert 1.3086031037335E+17 to 130860310373350000. We can do this by following these steps:
This how it looks combined:
Replace WorkflowVariable:sl_12hrsBeforeADTimeStamp in the below screenshot with WorkflowVariable:varText_requiredDateinADTimeStampFormat
The result of the above string operations should be something like this: 130860310373350000, when you pass this to AD, you should get the expected results.
The whole workflow is as follows (attached):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.