TomRiddle
-
Total Posts
:
620
- Scores: 12
-
Reward points
:
0
- Joined: 2/7/2008
- Location: Australia
-
Status: offline
|
Determine if a workstation is locked or not.
Tuesday, July 27, 2010 2:46 PM
( permalink)
After many hours of research and I have had multiple attempts over the years. I found VBSript can not determine if a workstation is locked or not. I ended up tweaking some C# code I found into a little console app that you can run from cmd prompt. It returns true or false if the workstation is locked. Failing this the only other method VBSript can use is to detect the screen saver process, useful if the screen saver also locks the screen but some people manually lock their workstation when they walk away. My latest discovery with PowerShell is that I can copy and paste my C# code straight into a script and it works just like the compiled exe version. If you are an advanced Powershell user check out Add-Type cmdlet it is really cool. Otherwise leave it to later as a little pot of gold at the end of the rainbow. PS C:\> get-help Add-Type -online
-join([int[]][char[]]'Ut|jwXmjqq%Wzqjx'|%{[char]($_-5)})
|
|
|
|