Question How to catch user activity and logging in and out?

UncleRonin

Well-known member
Joined
Feb 28, 2006
Messages
230
Location
South Africa
Programming Experience
5-10
Is it possible to somehow monitor or receive some sort of event notification whenever a user logs in and out of windows? The main reason behind this is to determine when some user remotes into a PC and to see who is currently logged on at any given time. Maybe I'm thinking about this all wrong but would you watch for an event or monitor a file or...?

One way is obviously is to start a small application process every time a user logs onto the machine (through the Startup folder or Run in the registry). This process can then notify a server or service somewhere and the status will be known...

Or is it possible to monitor the actual remoting part itself? So as soon as remote desktop is activated on the PC some flags change, etc. and then by monitoring these flags its possible to do the same as above...

Or how about monitoring incoming socket connections to the computer itself using some tool and watching a specific port?

*scratches* I really don't know which of these (if any) make the most sense or would serve this purpose... any ideas?
 
Perhaps you can use SystemEvents, SessionSwitch event has RemoteConnect/RemoteDisconnect detection. For a Windows Service instead override OnSessionChange, it has same functionality.
 
Back
Top