Solved

How do I interpret the date from a CSVDE export?

Posted on 2010-09-22
4
2,811 Views
Last Modified: 2012-05-10
My domain runs two domain controllers with Windows Server 2003.  I am trying to get data to support an Active Directory cleanup, so I need a clean, usable export of Active Directory using CSVDE.  I have my command written using the filters I need, and it exports beautifully except for one thing:  The dates and times that I need are in numerical format (I believe it is Unicode), for example 129207559115462000 is one date/time for a user's last logon.  The closest I have come to it Julian time / universal time, but it doesn't match up.  Can anyone help me to figure out what date and time this should be?  Is there a script that will convert these values to a more recognizable format?
0
Comment
Question by:laugle
4 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 33738787
I'd suggest using other tools for decoding  adfind and powershell (quest cmdlets) are two tools that will decode for you
adfind from Joe Richards http://www.joeware.net/freetools/tools/adfind/index.htm
adfind -default  -f "&(objectcategory=person)(objectclass=user)" samaccountname userprincipalname displayname lastlogontimestamp -csv -tdca > c:\LastLogon.csv
by the way if you are trying to cleanup old computers and/or users then old computer by Joe Richards is another great tool (has -users switch)
http://www.joeware.net/freetools/tools/oldcmp/index.htm
Thanks
Mike
0
 
LVL 7

Accepted Solution

by:
simonseztech earned 250 total points
ID: 33738811
csvde to excel Human readable LastLogon or LastLogonTimestamphttp://myserverstuff.blogspot.com/2009/03/csvde-to-excel-human-readable-lastlogon.htmlThe formula to convert from Active Directory LastLogon or LastLogonTimestamp is:=IF(C2>0,C2/(8.64*10^11) - 109205,"")Explanation:    * C2 is the cell that contains the Timestamp.    * The If() statement hides the value if the user has not logged in.    * (8.64*10^11) is the number of nanoseconds in a day divided by 100.    * 109205 is the number of days, including leap days, between 1601 and 1900. (Remember, 1900 is when excel dates "start")P.s. If you want it in Central US time (GMT-6), subtract 0.25 (That is 6 hours divided by 24 hours in a day). For Eastern time (GMT-5), subtract 0.208333333 .. (5/24).
0
 
LVL 39

Expert Comment

by:Adam Brown
ID: 33738818
That's actually an LDAP timestamp. This site: http://www.morecavalier.com/index.php?whom=Apps%2FLDAP+timestamp+converter will allow you to convert it to readable time.
0
 

Author Closing Comment

by:laugle
ID: 33738942
This is exactly what I needed!  A thousand thank yous!  ACBrown2010 - your solution works if I only had a few dates to convert - I have thousands, so the Excel command was what solved my problem.  Thanks to all for your help.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question