deploy when in a lock state
bstrache
Is there a way to deploy a program or batch file when the remote computers screen is locked? I see you can select logged on or off but not in a log state.
0
Comments
Powershell is your friend...
function GetRemoteLogonStatus ($computer = 'localhost') { if (Test-Connection $computer -Count 2 -Quiet) { try { $user = $null $user = gwmi -Class win32_computersystem -ComputerName $computer | select -ExpandProperty username -ErrorAction Stop } catch { "Not logged on"; return } try { if ((Get-Process logonui -ComputerName $computer -ErrorAction Stop) -and ($user)) { "Workstation locked by $user" } } catch { if ($user) { "$user logged on" } } } else { "$computer Offline" } }