+ Post New Thread
Results 1 to 9 of 9
Wireless Networks Thread, User logging utilities - Any free or cheap ones to recommend in Technical; We used Classlink and Ranger in the past but due to problems with both of them decided to move to ...
  1. #1

    Join Date
    Sep 2006
    Location
    Reading
    Posts
    177
    Thank Post
    14
    Thanked 41 Times in 39 Posts
    Rep Power
    23

    User logging utilities - Any free or cheap ones to recommend

    We used Classlink and Ranger in the past but due to problems with both of them decided to move to regulating users actions by tailoring group policies in the AD ourselves (Win 2003 server in use). We have had few problems but have struggled to track users logging on and off PC's adequately. Unfortunately this has coincided with a major increase in the number of PC's the kids use and we are suffering more vandalism. I don't want to go back to Classlink or Ranger so does anyone have any suggestions? Thanks.

  2. #2
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,205
    Thank Post
    223
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30

    Re: User logging utilities - Any free or cheap ones to recommend

    I have a VB program I wrote that does this lists date time user computer ip etc to a set of files (Text) on a server share. If you have VB at your place it's easy enough to modify to use on your network? I am looking at sending it to a mdb but for now this suffices .




    Wes

  3. #3

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: User logging utilities - Any free or cheap ones to recommend

    Another easy way that you can knock up in 5mins is two scripts. Firstly, a logon script... a simple batch file:
    Code:
    echo %date%,%time%,logon,%computername%,%username% >> \\servername\sharename\logon.log
    Then a logoff script that contains:
    Code:
    echo %date%,%time%,logoff,%computername%,%username% >> \\servername\sharename\logon.log
    This should give you the basic details. If you need more detail just add the variable names. If you use this regularly you will probably want something a bit more robust logging to a couple of servers and probably database-based.

  4. #4

    Join Date
    Apr 2008
    Posts
    405
    Thank Post
    22
    Thanked 13 Times in 10 Posts
    Rep Power
    15
    Resurrecting an old thread!

    We have just decided to get right Ranger because of a consistent logon issue that hasn't been solved as yet. The one thing we will miss is the logging, the solution you both suggest about a small script is pretty good but I'm just wondering if anyone has found anything with more detail e.g Programs run at what time, that they could suggest?



    Thanks

  5. #5

    Join Date
    Oct 2008
    Location
    Leeds
    Posts
    218
    Thank Post
    21
    Thanked 17 Times in 17 Posts
    Rep Power
    14
    Quote Originally Posted by Ric_ View Post
    Another easy way that you can knock up in 5mins is two scripts. Firstly, a logon script... a simple batch file:
    Code:
    echo %date%,%time%,logon,%computername%,%username% >> \\servername\sharename\logon.log
    Then a logoff script that contains:
    Code:
    echo %date%,%time%,logoff,%computername%,%username% >> \\servername\sharename\logon.log
    This should give you the basic details. If you need more detail just add the variable names. If you use this regularly you will probably want something a bit more robust logging to a couple of servers and probably database-based.
    We use something similar. However, when logging to one log file I found that the size of the logfile would reset to zero intermitently, thereby losing the logs.

    I did some research and I think that this happens when two processes try to append to the logs file at almost precisely the same time (the first one momemarily locks the file, and then the second tries to append, finds that it is locked/can't access it and creates a new file, thereby deleting the contents of the original log file).

    So I changed the scripts to log to a seperate file for each user

    Code:
    the same as yours >> \\servername\sharename\user\%username%.log
    This also allows you to see a simple history of where and when someone is logging on/off, and where they are currently logged on for remote desktop support (very handy).

    I also do the same but creating a seperare logfile per PC, rather than per user, which shows who has logged on and off to any particular PC. I think you can guess how it goes.....

    Code:
    the same as yours >> \\servername\sharename\computer\%computername%.log
    quite simple really

    Finally, we have another logfile, one master file like you described originally, but I had to convert this to VBScript, which didn't suffer from the same 'bug' of it resetting the logfile to 0 bytes.

    So we now have 3 log files which are written to at logon/logoff.

    Thanks,

    Bruce.
    Last edited by Bruce123; 20th December 2009 at 07:42 AM.

  6. #6

    Join Date
    Mar 2008
    Location
    Kent
    Posts
    99
    Thank Post
    33
    Thanked 11 Times in 11 Posts
    Rep Power
    14
    One I found on here a while back and have been using at a number of schools

    Add this VBScript to run on login:

    'log Machine Usage
    Option Explicit
    Dim strUserDirectory, strCompDirectory, strDate
    Dim strUser, strComp
    Dim strUserFile, strCompFile
    Dim objWshNtwk, objFSO, objTextFile

    Set objWshNtwk = WScript.CreateObject("WScript.Network")

    strUserDirectory = "\\servername\logging$\Pupils"
    strCompDirectory = "\\servername\logging$\Computers"
    strDate = Now
    strUser = (objWshNtwk.UserName)
    strComp = (objWshNtwk.ComputerName)
    strUserFile = "\" & CStr(strUser) & ".txt"
    strCompFile = "\" & CStr(strComp) & ".txt"

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Const ForAppending = 8

    ' Username Log
    Set objTextFile = objFSO.OpenTextFile (strUserDirectory &_
    strUserFile, ForAppending, True)
    objTextFile.WriteLine ("User:" & ", " & strUser & ", " _
    & "Logged on to Computer" & ", " & strComp & ", " _
    & "at" & ", " & strDate)
    objTextFile.Close

    'computer name Log
    Set objTextFile = objFSO.OpenTextFile _
    (strCompDirectory & strCompFile, ForAppending, True)
    objTextFile.WriteLine ("Computer" & ", " & strComp & ", "_
    & "Was logged into by" _
    & ", " & strUser & ", " & "at" & "," & strDate)
    objTextFile.Close

    WScript.Quit
    And this VBScript to run at logoff:

    ' LOGOUT SCRIPT as follows

    Option Explicit
    Dim strUserDirectory, strCompDirectory, strDate
    Dim strUser, strComp
    Dim strUserFile, strCompFile
    Dim objWshNtwk, objFSO, objTextFile

    Set objWshNtwk = WScript.CreateObject("WScript.Network")

    strUserDirectory = "\\servername\logging$\Pupils"
    strCompDirectory = "\\servername\logging$\Computers"

    strDate = Now
    strUser = (objWshNtwk.UserName)
    strComp = (objWshNtwk.ComputerName)

    strUserFile = "\" & CStr(strUser) & ".txt"
    strCompFile = "\" & CStr(strComp) & ".txt"

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Const ForAppending = 8

    ' Username Log
    Set objTextFile = objFSO.OpenTextFile (strUserDirectory &_
    strUserFile, ForAppending, True)
    objTextFile.WriteLine ("User:" & ", " & strUser & ", " _
    & "Logged out of Computer" & ", " & strComp & ", "_
    & "at" & ", " & strDate)
    objTextFile.Close

    'computer name Log
    Set objTextFile = objFSO.OpenTextFile _
    (strCompDirectory & strCompFile, ForAppending, True)
    'objTextFile.WriteLine (strUser & "," & strComp & "," & strDate)
    objTextFile.WriteLine ("Computer" & ", " & strComp & ", "_
    & "Was logged out of by" _
    & ", " & strUser & ", " & "at" & "," & strDate)
    objTextFile.Close
    WScript.Quit
    And finally run this batch as a task each night to tidy up the days records into an archive:

    @echo off
    title SPCTracker Archive Script
    echo.
    echo This batch script is archiving the days logfiles from SPCTracker.
    echo.

    echo.
    echo Access Physical Server Archive Location
    echo.
    E:
    cd \
    cd Logging
    cd Archive
    echo.
    echo Begin Archive Structuring for Day
    echo.
    md "%date:/=-%"
    cd "%date:/=-%"
    md "Staff"
    md "Pupils"
    md "Computers"
    echo.
    echo Back up to SPCTracker Root
    echo.
    cd ..
    cd ..
    echo.
    echo Start Copying Users Logfiles
    echo.
    cd Pupils
    move *.* "../Archive/%date:/=-%/Pupils/"
    cd ..
    cd Staff
    move *.* "../Archive/%date:/=-%/Staff/"
    cd ..
    echo.
    echo Start Copying Computers Logfiles
    echo.
    cd Computers
    move *.* "../Archive/%date:/=-%/Computers/"
    cd ..
    echo.
    echo Process Complete!
    echo.
    pause

    exit
    Then you will have a text file created for each user when they login which will be updated everytime they logon and logoff with the computer name. You will also have the same for each computer that is logged onto with the username of the person that has logged into it.

    You'll have to excuse the description, it's a bit early and my brain isn't working properly yet
    Last edited by gotenks1321; 20th December 2009 at 09:39 AM.

  7. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740
    Make a dir on the local pc called c:\logs [ you can edit this script to do so if you wish ] Compile the script and run it at logon. It will show this in the txt file and will add a new line everytime a user logs on:

    On 2007-01-24 18:30:30 : User: MattX Logged On To PC: MATTDELL, IP Address: 192.168.1.102

    AutoIT script:

    Code:
    ; AutoIt Version: 3.10
    ; Language: English
    ; Platform: WinXP
    ; Author: Matt Marsh
    ; Script Function: Script that records logon details in log file
    ; Date: Oct 2005
    
    
    Dim $sLogPath = "c:\logs\logger.txt"
    Dim $sLogMsg = "User: "
    _FileWriteLog($sLogPath, $sLogMsg)
    
    Func _FileWriteLog($sLogPath, $sLogMsg)
    
    Local $sDateNow
    Local $sTimeNow
    Local $sMsg
    Local $hOpenFile
    Local $hWriteFile
    Local $user
    Local $cname
    Local $ip
    
    $sDateNow = "On " & @YEAR & "-" & @MON & "-" & @MDAY
    $sTimeNow = @HOUR & ":" & @MIN & ":" & @SEC
    $user = @UserName
    $cname = @ComputerName
    $ip = @IPAddress1
    
    $sMsg = $sDateNow & " " & $sTimeNow & " : " & $sLogMsg & $user & " Logged On To PC: " & $cname & "," & " IP Address: " & $ip
    
    $hOpenFile = FileOpen($sLogPath, 1)
    
    If $hOpenFile = -1 Then
    SetError(1)
    Return 0
    EndIf
    
    $hWriteFile = FileWriteLine($hOpenFile, $sMsg)
    
    If $hWriteFile = -1 Then
    SetError(2)
    Return 0
    EndIf
    
    FileClose($hOpenFile)
    Return 1
    EndFunc
    This is the locally held version, I've got another version pointing over to a share - [ so each .txt file is written to a share on a server, I then have a combo box with the list of PCs in an array [ called from an .ini file ] which you can then choose to open up the relevant text file ] - to see the logon history. That is also run from a share so any teacher can use it on the network to check the logon history of a given PC. That code is on my box at work and I'm not back until January now but PM me if you want it and I'll add it to my to do list.....
    Last edited by mattx; 20th December 2009 at 10:16 AM.

  8. #8
    BJG
    BJG is offline
    BJG's Avatar
    Join Date
    May 2008
    Location
    Norwich
    Posts
    465
    Thank Post
    89
    Thanked 35 Times in 25 Posts
    Rep Power
    22
    ...just been asked to set up something to monitor "how often certain computers are used or last logon", and this was the only relevant thread I could find. I'm not really into hacking around with scripts though - hasn't anyone found a handy bit of software for this kind of thing...?

  9. #9

    Join Date
    Oct 2008
    Location
    Leeds
    Posts
    218
    Thank Post
    21
    Thanked 17 Times in 17 Posts
    Rep Power
    14
    You're better off using a script, all it needs to be is one simple line in a text file saved with a .bat extension and added to the domain logon script. Simplez.

    You could setup the entire thing in 30 minutes. Type this into Notepad:

    @echo %username% logon %computername% %date% %time% >> \\server\hiddenshare$\%computername%.txt

    Save this as logon-logon.bat, add it as a domain logon script, create a shared folder on the server for the logs giving it read/write permissions for all users.

  10. Thanks to Bruce123 from:

    BJG (23rd March 2010)

SHARE:
+ Post New Thread

Similar Threads

  1. Active Directory - Single and Bulk User creation and FREE!!
    By siuko in forum How do you do....it?
    Replies: 39
    Last Post: 20th June 2012, 11:29 AM
  2. cheap & cheerful Linux desk tops - who do you recommend?
    By Tiger in forum Recommended Suppliers
    Replies: 3
    Last Post: 16th November 2007, 03:55 PM
  3. Recommend a cheap XGA projector
    By mark in forum Hardware
    Replies: 12
    Last Post: 2nd July 2007, 10:39 AM
  4. Replies: 14
    Last Post: 15th June 2006, 09:11 AM
  5. Recommend a cheap network printer
    By Kyle in forum Hardware
    Replies: 15
    Last Post: 14th June 2006, 04:42 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
  •