Thursday 17 April 2014

Stop disconnecting my session, stop windows sessions timing out, stop locking the work station.

I’ve picked up a little assignment on a new 2008R2 machine.  I’m running TC’s and all sorts of things and the machine is locking me after 5 minutes of inactivity.  Come on!  You turn away for a minute to google something and and the screen is locked.  Also, it gets better, it logs me out after an hour!!!!

I’ve raised a bunch of calls, but you’d think I was working for the CIA, too secure to change these settings for me.  Okay…  No worries.  I’ve created a little vbscript to help me…  Wrong I know, but…

Copy below into “StopLockingMyMachine.vbs – save

set objShell = wscript.createobject("WScript.Shell")

Do until success = True
  Success = objshell.AppActivate("something.txt - notepad") 
  objShell.sendkeys FormatDateTime(Time,4) & " I'm sleeping for 2 minustes Shhhhhh ~"
  objShell.SendKeys "%{TAB}"
  wscript.sleep 120000 
  success = false
Loop

Then start->run->notepad something.txt

Double click your StopLockingMyMachine.vbs script.

run your script.  Every two minutes it’ll activate the notepad window and type a message into it, then it’ll take you back from whence you came…  Oh, this has saved me…

I’d stop it if you were doing lots of sensitive things, but if you are checking TC’s and things, it’s a belter.

No comments: