Processing Active Directory timestamps in Node-RED

I recently had a need to process Active Directory timestamps in Node-RED (based on the output from LDAP) to work out if a specific action should be carried out on a user or not. Microsoft is a bit weird (Microsoft) here where ‘the value is stored as a large integer that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC)’. It’s used in a fair few fields (and in other places in Windows) including in:

  • accountExpires
  • pwdLastSet
  • lastLogonTimestamp

Stack Overflow to the rescue with a comment that got me 99% of the way there, just needed to tweak the outputs as shown below with the code dropped into a function node.

0
Be the first one to like this.
Please wait...

Leave a Reply

Your email address will not be published. Required fields are marked *