Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. WSH an taking user statistics

WSH an taking user statistics

Scheduled Pinned Locked Moved System Admin
4 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    karanba
    wrote on last edited by
    #1

    Hi, I want to take simple statistics who use my computer. My OS is XP professional. I want to take every logon session user name time log on time log off and pass them in a xls file or even text file. I much more about know jscript than vbscript. thanx. karanba

    R 1 Reply Last reply
    0
    • K karanba

      Hi, I want to take simple statistics who use my computer. My OS is XP professional. I want to take every logon session user name time log on time log off and pass them in a xls file or even text file. I much more about know jscript than vbscript. thanx. karanba

      R Offline
      R Offline
      Ray Cassick
      wrote on last edited by
      #2

      You can enable log on and log off auditing and then read these events form the event security log of the event viewer.


      Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
      George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."


      K 1 Reply Last reply
      0
      • R Ray Cassick

        You can enable log on and log off auditing and then read these events form the event security log of the event viewer.


        Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
        George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."


        K Offline
        K Offline
        karanba
        wrote on last edited by
        #3

        Well, I want to do this to learn how to run wsh. If I get how to make a simple job like this I would go ahead on the subject. I learn how to take the user name and domain by using WScript.Network object and enviroment variables and could show them to a simple window. But I need an example *that open a file or DB connection to write in and close. *how to get sistem time *and how to make a script to work at log on and log off ( I do not want to put the script shortcut to the startup). :) karanba

        R 1 Reply Last reply
        0
        • K karanba

          Well, I want to do this to learn how to run wsh. If I get how to make a simple job like this I would go ahead on the subject. I learn how to take the user name and domain by using WScript.Network object and enviroment variables and could show them to a simple window. But I need an example *that open a file or DB connection to write in and close. *how to get sistem time *and how to make a script to work at log on and log off ( I do not want to put the script shortcut to the startup). :) karanba

          R Offline
          R Offline
          Ray Cassick
          wrote on last edited by
          #4

          karanba wrote: *that open a file or DB connection to write in and close. Here is a quick and dirty example of some VBscrip used to open and read from a DB

          strDSN = "FILEDSN=Distrib.mdb.dsn"
          Set cn = Server.CreateObject("ADODB.Connection")
          cn.Open strDSN
          Set rsDistrib = Server.CreateObject("ADODB.Recordset")
          strSQL = "SELECT TCountry FROM CountryCombo"
          rsDistrib.Open strSQL, cn
          Set objCountry = rsDistrib("TCountry")
          '=== start do
          Do Until rsDistrib.EOF
          theCountry(indCountry) = objCountry
          rsDistrib.MoveNext
          indCountry = indCountry+1
          Loop
          cn.close

          karanba wrote: *how to get sistem time Try this:

          msgbox Time()

          karanba wrote: *and how to make a script to work at log on and log off In Windows 200 (and XP I belive) you can set the machines policy to run a logoff as well as login script. Sending data to DB should not be hard here since they support WSH in these scripts. Windows px would require a utillity to be installed that would provide this functionality. Windows NT you would have to write your own GINA library to manage the process of login and logoff. Not a trivial task.


          Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
          George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."


          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups