I have several Windows 7/2008 workstation in my domain environment. We have a GPO that autolocks Window if no one is working on it(idle). No screensaver just lock.
How can I remotely check whether the remote workstation is Locked or Unlocked? I tried to query user using quser command (tested on user whose Windows is locked or another user whose Windows is unlocked, same result)
C:\>psexec \\REMOTEPC1 quser USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME USER1 console 1 Active none 1/24/2017 11:21 AM
The above result is showing STATE=ACTIVE, but I am unable to query if the workstation is LOCKED/UNLOCKED. How can I get required result by command or other method?