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)
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.
- Put the SCREENSAVER LOGOFF.SCR in the SYSTEM32 folder on the base Windows image (rename the file if you need to).
- In a GPO, enforce this as the screen saver and set the timeout desired.
- Apply the GPO however desired (Group, Machine, Users, etc.).