One of my colleagues pointed out the new Fine-grained password policy feature in Windows Server 2008. As you can see in this post at The Sean Blog, some values have to be entered in the I8 format, which isn’t very user friendly. Because of that, he asked me if I could whip up a tool that converts days, hours, minutes and seconds to the I8 format. I quickly put together this small tool for him. It hasn’t been tested extensively, but I think it might be of some use to some of you.
For example, I used longs to store the info. When wanting to calculate huge values, this won’t work of course. This could be improved by using the multipliers divided by for instance 10,000,000 and add the appropriate amount of zeros (7) to the string after calculation, so the numerical value stays a lot smaller. Still, I think it does what it should do at this point. You can find the sourcecode [over here], or if you would like te change anything: be my guest. Let me know if you find bugs or add cool features: I would like to know.
Info taken from Technet:
When you use the ldifde command to create PSOs, you must enter the values of these attributes in I8 format, which stores time in the intervals of -100 nanoseconds. (Schema: attributeSyntax = 220.127.116.11 (I8).) Windows Server 2003 Default Domain Policy employs this exact time unit for its corresponding time-related attributes. To set these attributes to appropriate values, convert time values in minutes, hours, or days to time values in the intervals of 100 nanoseconds, and then precede the resultant values with a negative sign.
** Tool: https://www.rickvandenbosch.net/downloads/I8Converter.zip
Source: <https://www.rickvandenbosch.net/downloads/I8Converter Sourcecode.zip>
** Because of a hosting shift, the tool is no longer available from the above locations. When interested: [drop me a line]. I’ll see if I still have the app/sourcecode floating around somewhere.
: https://www.rickvandenbosch.net/downloads/I8Converter sourcecode.zip