tags:

views:

103

answers:

2

Is there any way to detect, through WSH, which workstations, in a windows domain, has a locked session?

+1  A: 

http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1115.mspx

If you scroll down, there is a check if computer is locked script on the page. The script basically grabs the running processes for the machine and looks for the scrnsave.exe.

It is also worth noting that the author of this script states that he does not know of a foolproof way to determine if a computer is locked. Hope this helps or at least points you in the right direction.

daub815
A: 

Not sure if you are using locked as in locked or as in hung but I use pstools to check for systems with the screen lock turned on. My command line is:

pslist \machinename > machinename.txt

then check the machine_name.txt file for logon.scr if present the screen is locked.