techguy86 Posted March 11, 2004 Posted March 11, 2004 I need some ideas and coding on how to use AutoIt 2.64 to log usernames, computer names, the time(Hour:Min:Sec), and the date that a user logs into and out of a library computer. I also need the time spent on the computer recorded. I've made a script to record the logins. I appended the info to a file like this: "username" logged onto "computername" at 12:34:23 on 03-11-04. I used the registry to run the program hidden at login as to not disrupt computer usage. I need some way to log logouts, in the form of: "username" logged out of "computername" at 12:44:23 on 03-11-04. Time logged on: 00:10:00 --------------------------------------------------------------------------------- "username" logged into "computername" at 12:34:23 on 03-11-04. "username" logged out of "computername" at 12:44:23 on 03-11-04. Time logged on: 00:10:00 --------------------------------------------------------------------------------- I need this kind of information for everyone who logs on and off. Is there a registry entry I can use to run a file at log out, but not at shutdown. Any help would be appreciated, Computerguy My Programs:Dissolve (Updated 5-30-06)Credit Card Validator (Not created as of yet)Master Lock Combination Cracker (Updated 7-08-07)Go Site-Seeing:My Website: - Click Here
ezzetabi Posted March 12, 2004 Posted March 12, 2004 (edited) you can check the modification of the USERNAME variable. AFAIK (you have to test) it is Null when none is logged off, when it decome a value you know that user has logged on, when it returns Null you know that he logged off. Of course you have to start the script as service Edited March 12, 2004 by ezzetabi
ezzetabi Posted March 12, 2004 Posted March 12, 2004 (edited) Here we are, should work... Hopes so... expandcollapse popupBegin: IfInString,USERPROFILE,Default,goto,NoneIsLoggedOn ;Else Begin2: SetEnv,logged,%username% RunWait,cmd /c echo %username% Logged on at %A_HOUR% : %A_MIN% of %A_YEAR%.%A_MON%.%A_MDAY%>logfile.txt,,hide Check: IfEqual,logged,%username%,Goto,WaitNextCheck ;-- The user logged off IfInString,USERPROFILE,Default,goto,UserLoggedOff ;-- The user changed in the 30 sec pause between checks... RunWait,cmd /c echo %logged% Logged off at %A_HOUR% : %A_MIN% of %A_YEAR%.%A_MON%.%A_MDAY%>logfile.txt,,hide Goto,Begin2 exit WaitNextCheck: ;-- If you are here someone is logged on and you are waiting that it goes offline. Sleep,30000 Goto, Check exit ;-- If you are here none is logged on... NoneIsLoggedOn: Sleep,30000 Goto,Begin exit UserLoggedOff: RunWait,cmd /c echo %logged% Logged off at %A_HOUR% : %A_MIN% of %A_YEAR%.%A_MON%.%A_MDAY%>logfile.txt,,hide Sleep,30000 Goto,Begin Edited March 15, 2004 by ezzetabi
Beastmaster Posted March 12, 2004 Posted March 12, 2004 Well, I guess there's something in the web (freeware) which would cover that task, beside the fact that's a nice challenge to solve it with AutoIt ... Hope you're not an employer (in some areas of this world, you would need a lawyer to get out of this, if catched). I hope you're not an admin (employee), you could go to jail on behalf or accompanied by your boss. In our company the workers council had to inform the employees (by law) that BigBrother wanted start listening ...
ezzetabi Posted March 12, 2004 Posted March 12, 2004 Ohh... only know who is logged on is not a big crime... It is? He's not spying activities with screenshot and the like...
Beastmaster Posted March 13, 2004 Posted March 13, 2004 Login and logout isn't an activity ?... only know who is logged on is not a big crime ...You're right, but how to get that information could be one ...We had colleagues which switched off/logged out at 03:00 (while 05:00 would have been standard). They're no longer with us ... If that's the task, he has to keep the legal aspects in mind, otherwise such evidence won't stand before a court.If monitoring is necessary to secure a box ask your admin, he's able to do that remotely.Or use a desktop wallpaper "This PC will be monitored". This should keep those away which have no permission to access.
Beastmaster Posted March 13, 2004 Posted March 13, 2004 ... BTW: Bill Gates delivers a unsuspicious spy tool called "Messenger". Run it at startup on the target box, add your target user to your buddy list and with his/her login/logout you will be "notified" in realtime.
ezzetabi Posted March 15, 2004 Posted March 15, 2004 For starting scripts as services you may find usefulFiredeamon
Recommended Posts