Converting Active Directory Date Time Attributes

To convert a date time attribute in Active Directory (e.g. as used by lastLogon) to a human readable date time, you can use the w32tm command.

For example with the following LDAP record:

dn: CN=John Smith,CN=Users,DC=DC=example,DC=com
lastLogon: 128326919184182832

Running

w32tm /ntte 128326919184182832

Will give the output

148526 12:38:38.4182832 - 27/08/2007 13:38:38 (local time)

See Microsoft Knowledge Base article 555936 for more information.

This entry was posted in Sysadmin and tagged , . Bookmark the permalink.

One Response to Converting Active Directory Date Time Attributes

  1. Prethesh Kumar Bhalotia says:

    Wow what a command. It correctly coverts the nanosecond to exact time:) thanks a lot.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>