Announcement

Collapse
No announcement yet.

how to create batch file for user login information

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to create batch file for user login information

    Hi All,

    I am working as a system administrator in gameing company around with 90 systems..server is win server

    2003 and all clients are Windows xp professional....

    I want to create batch file for user login and logoff information..

    That log file should have below information

    1) user name
    2) computer name
    3) Date of login
    4) Time of login.

    How can i do that...when user login to any client on my network...that information is directley store in

    server in a text file...how can i do that...

    Please help me

    Thanks in advance...

  • #2
    Re: how to create batch file for user login information

    All this information is held in the Security logs. You could use a log analyzer like Log Parser to export this or look at this KB article
    Last edited by nmarchini; 8th January 2009, 09:40.

    Comment


    • #3
      Re: how to create batch file for user login information

      Hey Guys...

      I find out the solution for tracking the user login information.Below is the code

      echo "Logon Date:%date%,Logon Time:%time%,Computer Name:%computername%,User Name:%username%,Server Name:%logonserver%" >> \\ServerName\Tracking\LOGON.TXT

      Write down this code in notepad and save it as .bat extension..

      Here my problem is started..

      The problem is when run the batch file normally means double click on that batch file,the information is stored like this...

      "Logon Date:Thu 01/08/2009,Logon Time:17:08:38.55,Computer Name:7STL138,User Name:7stl052,Console,Server Name:\\MDCSRV"

      Suppose the batch file is placed on startup folder using Local computer policy > Computer Configuration > Windows settings > Scripts > startup.

      When the client logon to any client, the login information is store like this

      "Logon Date:Thu 01/08/2009,Logon Time:17:08:38.55,Computer Name:7STL138,User Name:,,Server Name:\\MDCSRV"

      Find the User Name is missing...My main aim is i want trace username...but it's missing from logon script..

      I can't able to find out where the problem..please help me..

      Thanks in Advance

      Comment


      • #4
        Re: how to create batch file for user login information

        Hey Guys...

        I find out where i done mistake...I create Logon and Logoff script under computer configuration,so its not showing user name...

        I create Logon and Logoff script under user configuration...it's showing user name...

        Now..i able to trace user login information along with username,computer name,logon time and logon date...

        Thanks for all..

        All the best..

        Comment


        • #5
          Re: how to create batch file for user login information

          Note that having multiple users writing to the same file might fail if two or more users are trying to write to the file simultaneously.

          Comment


          • #6
            Re: how to create batch file for user login information

            A safer way would be to write to a different file - either per user or per computer. While this means more files, it does offer the advantage of protecting you against the problem raised by Smart-X, and also lets you see the history of one machine or user at a time.
            Gareth Howells

            BSc (Hons), MBCS, MCP, MCDST, ICCE

            Any advice is given in good faith and without warranty.

            Please give reputation points if somebody has helped you.

            "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

            "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

            Comment


            • #7
              Re: how to create batch file for user login information

              Originally posted by gforceindustries View Post
              A safer way would be to write to a different file - either per user or per computer. While this means more files, it does offer the advantage of protecting you against the problem raised by Smart-X, and also lets you see the history of one machine or user at a time.
              By using the variable %computername% as part of the logfile's name.

              Afterwards you can use a copy /b command in a batch to merge all the log files and open it in excel.
              http://forums.petri.com/showthread.p...212#post124212

              \Rems

              This posting is provided "AS IS" with no warranties, and confers no rights.

              __________________

              ** Remember to give credit where credit's due **
              and leave Reputation Points for meaningful posts

              Comment

              Working...
              X