WSH an taking user statistics
-
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
-
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
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."
-
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."
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
-
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
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.closekaranba 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."