How to detect if a session is locked or disconnected ?

Started by troncy, March 15, 2014, 11:44:29 AM

Previous topic - Next topic

troncy

Bonjour,

The question is in the subject... I cannot see any simple solution to do that.

Thanks in advance and best regards
Claude

ChuckC

Look in the WIL Consolidated Help file at the topic for the Terminal Service extender.

In particular, the topic for the function wtsQuerySessionInfo() will be of interest to you; the function returns an array of strings, and element 1 of the array contains a string value that identifies what state the session is in.

Also, look at the help topic for the function wtsProcIdToSessId(), which has sample code showing how to first get the PID of your script's own process and then using that PID value to get your terminal services session ID value so that you can then query the session for information.

troncy

Merci beaucoup.... Thanks a lot.

Best regards
Claude