Check Whenever Locked or Not via SSH on Windows
If you’re looking to determine whether a Windows machine is locked or not via SSH, you can use PowerShell commands to achieve this. The Get-Process
command with the logonui
argument can be used to check the status of the “LogonUI” process, which is responsible for the Windows login screen. If the “LogonUI” process is running, it typically means that the user is logged in and the machine is not locked. If the process is not running, it might indicate that the machine is locked or at the login screen.