I want to run an application on closing/Disconnecting Remote Desktop Connection. Is there's any way to keep record of Remote desktop session start-stop timing in winndows xp/win 7.
You can write a Windows service and listen for SERVICE_CONTROL_SESSIONCHANGE. One of the parameters for that event is the session state, which in this case you would be interested in either WTS_SESSION_LOGON/WTS_SESSION_LOGOFF or WTS_REMOTE_CONNECT/WTS_REMOTE_DISCONNECT depending on your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With