No announcement yet.

Last true logon (cmd)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Last true logon (cmd)


    I want to create a CSV-file with the users and there last true logon (timestamp)

    I know that Exporter and Hyena is the best tool, but I can't use them in a script (or can I?)

    I can use DUMPSEC, and in dumpsec gui I can create the report as I want.

    In DUMPSEC Command line I use
    DumpSec /computer=domaincontroler /rpt=users /showtruelastlogon /saveas=csv /noheader /outfile=users.txt

    But that takes nearly everything on the user and take a long time to run.
    Again I only need user and lastlongon.

    Can I do something else?

  • #2
    Re: Last true logon (cmd)

    There's no way to limit the fields when running DumpSec from the command line. You can try Exporter Pro for this. It has the ability to search all domain controllers, to specify the fields you want to export, and can be run from the command line.


    • #3
      Re: Last true logon (cmd)

      I know I have seen it somewhere, and for the life of me after much searching cannot find it, but you described how to do this via command line and I managed to create the script to show last true logon for users which unfortunately disappeared when my laptop went up in smoke.
      Would you be able to give a step by step description of how to run this report with Exporter Pro via Command Line?

      many Thanks and humble apologoes for getting you to repeat yourself.


      • #4
        Re: Last true logon (cmd)

        To get last logon information from your users, it is best to use Exporter Pro for this because it can check all domain controllers, whereas Hyena will only look at one controller. Last Logon is stored locally on each domain controller and not part of the data that gets replicated between them.

        Click on your domain in Hyena to select it, then go to Tools->Exporter Pro->Export Selected Objects. Click the Settings button, then double-click on Detailed Users under Active Directory. Check the box to enable it and enter an output filename. Click the button for Set Options and check the box to export information from all domain controllers. Also make sure Last Logon is listed in the window as one of the fields to export.

        Run that export and when finished you can open the output file with Excel.

        Once you have it configured in Exporter Pro the command line syntax is:

        stexport.exe /CONFIG=path_to_your_ini


        • #5
          Re: Last true logon (cmd)

          Many Thanks.

          Got it working now.