Thincomputing.net
1Jun/111

Logoff Idle Windows Sessions via Screen Saver

Nice little script that allows to you to popup a message box to the end user warning them they will be logged out in 1 minute unless they click CANCEL when the screen saver kicks in.

The EXE and SCR are the same thing (one does not need the other). A little known fact about Windows....if you rename an EXE to SCR, you can still launch it like an EXE but also launch it through the Screen Saver settings.

Since I wrote it in KiXtart, the actual base code is this simple call....

$OKCancel = MessageBox("Your Windows Session has been idle for too long and you are about to be logged off!@CRLF@CRLFIf you do not wish to be logged of, Please select CANCEL Now!  Otherwise, your Windows Session will be logged off in less than 1 minute.", "Logging Off Your Session!", 262193, 60)

If Not $OKCancel = 2

$Nul = LogOff(1)

EndIf

Essentially, this is popping a message box to the end user warning them they will be logged out in 1 minute unless they click CANCEL. If you use the "/SHOWCODE" switch, all of the rest of the stuff is the code for the "/SHOWCODE" switch to work.

Screen Saver Logoff Message

To implement:

  1. Put the SCREENSAVER LOGOFF.SCR in the SYSTEM32 folder on the base Windows image (rename the file if you need to).
  2. In a GPO, enforce this as the screen saver and set the timeout desired.
  3. Apply the GPO however desired (Group, Machine, Users, etc.).

Source: http://t3chnot3s.blogspot.com/2011/04/logoff-idle-windows-sessions-via-screen.html

Similar Posts:

Filed under: News Leave a comment
Comments (1) Trackbacks (0)

Leave a comment

No trackbacks yet.

Get Adobe Flash player