Determine if a workstation is locked or not.

Author Message
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)
0
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)})
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9