+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 34
Windows Thread, Track user logons? in Technical; In Server 2003 is there any way i can track who is logging on when and/or where? We have an ...
  1. #1

    Join Date
    Jun 2007
    Location
    Rotherham
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Track user logons?

    In Server 2003 is there any way i can track who is logging on when and/or where? We have an issue where one of our staff members seems to be logging on as another user, or as themsleves at strange times?

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Track user logons?

    You can do this via audit logging.

  3. #3

    Join Date
    Sep 2006
    Location
    Essex
    Posts
    786
    Thank Post
    1
    Thanked 34 Times in 32 Posts
    Rep Power
    24

    Re: Track user logons?

    Try these VB Scripts

    Logon.vbs

    Code:
    Const ForReading = 1, ForWriting = 2, ForAppending = 8 
    Set objNetwork = CreateObject("Wscript.Network") 
    
       Dim fso, f 
       Set fso = CreateObject("Scripting.FileSystemObject") 
    
    'alter the path to the file as needed for your environment 
    
    strNewFile = "C:\Userlog" & Replace(FormatDateTime(Now(), vbShortDate) & ".csv", "/", "") 
    
    Set f = fso.OpenTextFile(strNewFile, ForAppending, True)
    
    strComputer = objNetwork.ComputerName 
    strUser = objNetwork.UserDomain & Chr(92) & objNetwork.UserName 
    
    'alter the text strings as you like 
    f.Write strUser & "," & strComputer & "," & Date & "," & Time & "," & "Logon" & vbCrLf
    f.Close
    Logoff.vbs

    Code:
    Const ForReading = 1, ForWriting = 2, ForAppending = 8 
    Set objNetwork = CreateObject("Wscript.Network") 
    
       Dim fso, f 
       Set fso = CreateObject("Scripting.FileSystemObject") 
    
    'alter the path to the file as needed for your environment
    strNewFile = "C:\Userlog" & Replace(FormatDateTime(Now(), vbShortDate) & ".csv", "/", "") 
    
    Set f = fso.OpenTextFile(strNewFile, ForAppending, True)
    
    strComputer = objNetwork.ComputerName 
    strUser = objNetwork.UserDomain & Chr(92) & objNetwork.UserName 
    
    
       'alter the text strings as you like 
       f.Write strUser & "," & strComputer & "," & Date & "," & Time & "," & "Logoff" & vbCrLf
       f.Close
    These scripts log the username, computer name, time, date and the event to a date coded csv file.

    I would recommend that CSV file is located on a server share and the path to the file modified for both scripts.

  4. #4
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    30

    Re: Track user logons?

    Can it be a UNC path then for the logfile?

    Nath.

  5. #5

    Join Date
    Sep 2006
    Location
    Essex
    Posts
    786
    Thank Post
    1
    Thanked 34 Times in 32 Posts
    Rep Power
    24

    Re: Track user logons?

    Quote Originally Posted by tarquel
    Can it be a UNC path then for the logfile?

    Nath.
    Yes, however the user will need write access to the UNC path if the scripts are executed at user logon\logoff

  6. #6

    Join Date
    Mar 2007
    Posts
    1,860
    Thank Post
    93
    Thanked 325 Times in 245 Posts
    Rep Power
    92

    Re: Track user logons?

    echo %date% %time% %computername% %username% >>\\servername\logon\log.txt

    tack that onto your logon script. works a treat.

  7. #7

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,832
    Thank Post
    971
    Thanked 1,385 Times in 849 Posts
    Blog Entries
    1
    Rep Power
    457

    Re: Track user logons?

    I created my own system based on autoit and php/mysql
    It logs times when people log on, where they are, when they leave and I have it projected onto a wall giving the current amount of staff,pupils and the amount of pc's logged onto this week (like 200/500).
    Its web based for viewing the DB and you can wildcard search for pcs and users.
    I can provide the info you need to enable your network to do it.

  8. #8
    kearton's Avatar
    Join Date
    May 2007
    Location
    Yorkshire, via NZ ;)
    Posts
    908
    Thank Post
    178
    Thanked 119 Times in 96 Posts
    Rep Power
    49

    Re: Track user logons?

    i'd be very interested in that, ZeroHour... (as I'm sure many others would)

  9. #9
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,987
    Thank Post
    275
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    48

    Re: Track user logons?

    Sounds great ZH - how much can I pay you!

  10. #10

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,832
    Thank Post
    971
    Thanked 1,385 Times in 849 Posts
    Blog Entries
    1
    Rep Power
    457

    Re: Track user logons?

    Cool, if there is a interest I will work on a pack for some people to test.
    PM me if you would like to help beta test. MSN Messenger users are v welcome as its faster for debugging.

    Mark I accept beer like all good techies

  11. #11

    Join Date
    Jun 2007
    Location
    Rotherham
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Track user logons?

    Quote Originally Posted by strawberry
    echo %date% %time% %computername% %username% >>\\servername\logon\log.txt

    tack that onto your logon script. works a treat.
    Ive tried that but it doesnt seem to work?

  12. #12

    Join Date
    Jun 2007
    Location
    Rotherham
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Track user logons?

    Quote Originally Posted by djm968
    Try these VB Scripts

    Logon.vbs

    Code:
    Const ForReading = 1, ForWriting = 2, ForAppending = 8 
    Set objNetwork = CreateObject("Wscript.Network") 
    
       Dim fso, f 
       Set fso = CreateObject("Scripting.FileSystemObject") 
    
    'alter the path to the file as needed for your environment 
    
    strNewFile = "C:\Userlog" & Replace(FormatDateTime(Now(), vbShortDate) & ".csv", "/", "") 
    
    Set f = fso.OpenTextFile(strNewFile, ForAppending, True)
    
    strComputer = objNetwork.ComputerName 
    strUser = objNetwork.UserDomain & Chr(92) & objNetwork.UserName 
    
    'alter the text strings as you like 
    f.Write strUser & "," & strComputer & "," & Date & "," & Time & "," & "Logon" & vbCrLf
    f.Close
    Logoff.vbs

    Code:
    Const ForReading = 1, ForWriting = 2, ForAppending = 8 
    Set objNetwork = CreateObject("Wscript.Network") 
    
       Dim fso, f 
       Set fso = CreateObject("Scripting.FileSystemObject") 
    
    'alter the path to the file as needed for your environment
    strNewFile = "C:\Userlog" & Replace(FormatDateTime(Now(), vbShortDate) & ".csv", "/", "") 
    
    Set f = fso.OpenTextFile(strNewFile, ForAppending, True)
    
    strComputer = objNetwork.ComputerName 
    strUser = objNetwork.UserDomain & Chr(92) & objNetwork.UserName 
    
    
       'alter the text strings as you like 
       f.Write strUser & "," & strComputer & "," & Date & "," & Time & "," & "Logoff" & vbCrLf
       f.Close
    These scripts log the username, computer name, time, date and the event to a date coded csv file.

    I would recommend that CSV file is located on a server share and the path to the file modified for both scripts.
    Im sorry, i dont know VB. Ive nver really looked at it so i dont know that to do with the information you have given me! ops:

  13. #13

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,832
    Thank Post
    971
    Thanked 1,385 Times in 849 Posts
    Blog Entries
    1
    Rep Power
    457

    Re: Track user logons?

    The biggest problem with these scripts are that if a pupil wants to be evil he can clear the logs as he has permissions. I know I would look/find it if I was going to do damage.

    Let me rephrase my beta call-out, I need people to help me make sure its generic for every network before I release it to the wild. I dont see any problems but best to test
    Its fairly simple and since its web based primarily, it should not effect your network running it. It works good for us and kids would have a v hard time faking entries.

    Added: This post has a couple of screenie showing 2 aspects of the sys.
    Attached Images Attached Images

  14. #14

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Track user logons?

    OCS Inventory logs user logins.

  15. #15

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,832
    Thank Post
    971
    Thanked 1,385 Times in 849 Posts
    Blog Entries
    1
    Rep Power
    457

    Re: Track user logons?

    Oooh having a look. Does it log logout times?



SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Script to track user logins
    By Gatt in forum Scripts
    Replies: 47
    Last Post: 2nd August 2013, 11:44 AM
  2. Restricting Logons
    By Espada in forum Windows
    Replies: 2
    Last Post: 6th December 2007, 06:51 PM
  3. How do you keep track of you daily jobs?
    By Little-Miss in forum General Chat
    Replies: 28
    Last Post: 14th October 2007, 03:15 PM
  4. Slow Logons
    By andyrite in forum Windows
    Replies: 3
    Last Post: 24th April 2007, 10:48 AM
  5. Replies: 16
    Last Post: 29th March 2006, 04:52 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •