« Previous Next »

Thread: Convert LastLogon output to standard date and time

Last post 10-27-2009 4:31 PM by ksingla. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-27-2009, 3:22 PM

    • hg363
    • Top 100 Contributor
    • Joined on 09-04-2007, 7:44 PM
    • Posts 54

    Convert LastLogon output to standard date and time

    Hi again to all forum members. Please can some one kindly assist me with this one.

    Having run this query

    string_is = " -i:ADS -objClass:user -o:DATAGRID " & """ SELECT cn, lastLogon FROM 'Domain Name' where sAMAccountName='HG363'"""

    The output is as follows

    Ghelani Hinesh 129010954238990075

    How would one then go on and convert this to a normal date such as dd/mm/yyyy + the relevant time?

    Kind regards HG363 London, UK

  • 10-27-2009, 4:31 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: Convert LastLogon output to standard date and time

    Not sure how you can do that in the query but you can use "w32tm /ntte <lastLogonTime>" to convert NT system time into readable format.

    Follow me on twitter at http://twitter.com/kjsingla
Page 1 of 1 (2 items)
Microsoft Communities