23 February 2011
Convert lastlogon timestamp to readable format using W32TM and Excel
You can convert lastlogontimestamp to readable date format using W32TM command
w32tm /ntte (lastLogon attribute value)
C:\>w32tm /ntte 127281844863301000
147316 22:48:06.3301000 - 5/5/2004 4:18:06 AM (local time)
It’s very difficult to use this command for bulk extract, we can convert this in Excel itself using below procedure.
You can use below formula to convert UTC format to normal readable format in Excel.
=IF(A1>0, DATE(1601,1,1) +A1 /600000000/1440,"")
A1 is the cell that contains the Timestamp.
Yes, in Excel itself you can convert lastlogon and lastlogontimestamp to a normal readable format no need for additional script and command, we can use this simple procedure to extract lastlogon timestamp from active directory without using a script, more about CSVDE
You can also use our online windows timestamp converter
How to extract bulk object from AD with the specific attributes (Part 1)
How to extract the user who has the option Password never expires in the OU
Force active directory replication
More useful commands Share this . . .