Sign in to follow this  
Followers 0
techguy86

Computer Monitoring

8 posts in this topic

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.

:whistle: 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 Siteseeing:My Website: - Click HereCyberZeroCool's Website - Click Here

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by ezzetabi

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Here we are, should work... Hopes so... :whistle:

Begin:
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 by ezzetabi

Share this post


Link to post
Share on other sites

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 ...

Share this post


Link to post
Share on other sites

Ohh... only know who is logged on is not a big crime... It is?

He's not spying activities with screenshot and the like...

Share this post


Link to post
Share on other sites

Login and logout isn't an activity :whistle: ?

... 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. B)

Share this post


Link to post
Share on other sites

... 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.

Share this post


Link to post
Share on other sites

For starting scripts as services you may find useful

Firedeamon

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0