Re: report showing who logged in/out of nt 4 server

From: Al Dunbar (LuigiDunbar@hotmail.com)
Date: 03/10/02

  • Next message: robot: "Re: report showing who logged in/out of nt 4 server"

    From: "Al Dunbar" <LuigiDunbar@hotmail.com>
    Date: Sun, 10 Mar 2002 01:06:42 GMT
    
    

    "robot" <nospam@antispam.com> wrote in message
    news:D4Jh8.28951$ro5.13733742@typhoon.ne.ipsvc.net...
    > Thank you Al for the suggestion. Being inexperienced in this, I am not
    sure
    > how to script the kixtart approach. Would it be possible for you to post a
    > small segment of code that demonstrates what you did?

    It is shown below. Cut-and-paste with care, as the "$tab" variable is set to
    a string containing a tab character, not the series of space characters that
    my newsreader editor will substitute for it. Also, the "$_site_LogRoot"
    variable is set elsewhere to the UNC where the \log\sessions\ directory is
    found. That directory needs to be read-write-able by all users. Finally, the
    statement that follows the one that defines the "$_tab" variable is wrapped
    onto the following line.

    The gist of this is that the active log file never gets too long, as it is
    named yyymmdd.txt. At the end of each month I run a batch file that
    concatenates the month's log files into one representing the entire month.
    To display one of these log files, another batch file concatenates them all
    into one temp file, adds a header line, and loads the works into excel with:

        start excel %temp%\logfile.txt

    The fields included are:

        date, in yyyy-mm-dd format
        time, in hh:mm format
        logonserver (authenticating bdc)
        workstation name
        responsibility centre (*)
        username

    The responsibility centre is a code that is specific to our environment, and
    indicates the financial coding for each facility in our organization. All
    servers belonging to such a facility are named such that this code forms the
    2nd, 3rd, and 4th characters of the name. It is there only to help identify
    when we have "guests" from elsewhere.

    /Al

     ;;;;;;;;;;;;;;
     ; extract various fields and generate the log record to be written

        $__hm = substr(@time,1,5)
        $__mm = substr(@date,6,2)
        $__dd = substr(@date,9,2)
        $__yy = substr(@date,1,4)
        $__rc = substr(@homeshr,4,3)
        $tab = ' '

        $_sessions_data =
    '$__yy-$__mm-$__dd$tab$__hm$tab@lserver$tab@wksta$tab$__rc$tab@userid'

     ; update the log file

        $_sessions_file = '$_site_LogRoot\log\sessions\$__yy$__mm$__dd.txt'
        shell 'command.com /c >>$_sessions_file echo.$_sessions_data'
     ;;;;;;;;;;;;;;

    > many thanks.
    >
    > "Al Dunbar" <LuigiDunbar@hotmail.com> wrote in message
    > news:DrCh8.87073$kb.5433857@news1.calgary.shaw.ca...
    > > Do you have login scripts? If so, add code to them to capture the info
    you
    > > want (date, time, username, workstation name, more?) and write it to a
    > file.
    > > Then write a script that you run periodically to load this info into
    > excel.
    > >
    > > We have done this in batch and kixtart, and may soon re-do it in WSH.
    > >
    > > /Al
    > >
    > > "robot" <nospam@antispam.com> wrote in message
    > > news:I1ph8.27550$ro5.12983450@typhoon.ne.ipsvc.net...
    > > > Newbie admin here with basic need. I would like to get a weekly report
    > > > showing when users have logged into and out of our win nt 4 server.
    > > Ideally,
    > > > it should be in a format I could read with Access, but I'm willing to
    > > settle
    > > > for anything, at least to start.
    > > >
    > > > I would expect this to be easy and basic, but I'm not sure where to
    > look.
    > > >
    > > > All suggestions appreciated.
    > > >
    > > > thanks
    > > >
    > > >
    > >
    > >
    >
    >



    Relevant Pages

    • Re: Rollout Registry Settings via SMS (w/Adv Clients)
      ... do have a similar script that launches an exe with the /s command ... line and also logs to a specific log file? ... so I went with DFS. ... batch file can point to the DFS share where the registry entries are located. ...
      (microsoft.public.sms.swdist)
    • Re: Current Directory of a Process
      ... can't recall the last time I executed a batch file, but the whole batch file methodology ... The script creates a log file, ... >current directory using the GetCurrentDirectorybefore invoking the script ...
      (microsoft.public.vc.mfc)
    • Re: unix shell script ignores exit when in function that is piped to tee
      ... > I thought calling a function within a script did NOT create sub-shells. ... is going to be able to alter the log file to cover up any inappropriate ... entry in the log to the previous entry. ... The easiest way to use crypt to ...
      (comp.unix.shell)
    • The necessity of Setting Objects to Nothing
      ... But what happens when you've got a script that is running as ... Dim Servers, List, strComputer ... Set Folder = objFSO.GetFolder ... '~~~ Write the results of the number of users query to a log file. ...
      (microsoft.public.scripting.vbscript)
    • Re: CSVDE Importing
      ... > specify the log file path via the -j option. ... CSVDE imports can only be used to create new users ... Unfortunately, the syntax is a bit more involved than a simple csv file, ... which makes it a little more difficult to manage its content via script. ...
      (microsoft.public.windows.server.scripting)