
need my users logoff automatically after 15 min
Quote:
> I am using W2kServer with a W2kProfessional attached. I need my client
> users to be automatically logoff after 15 or 30 minutes from the time of
> logon.
If the users always run a logon script, launch a new script asynchronously
(WSHShell.Run "<path>\<file>.vbs") that sleeps for 15 minutes (Wscript.Sleep 15
* 60 * 1000), and then use e.g WMI for the logout part (forced logout if you
wish).
If the users don't run a logon script, you can launch the script this way
instead:
From the Start menu Run dialog, open: gpedit.msc
Then, under "User Configuration",
open Windows Settings\Scripts (Logon/Logoff)
(double click, Add...).
VBScript/WMI for logout:
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8
Set wmi = GetObject("winmgmts:{(Shutdown)}")
set objset = wmi.instancesof("win32_operatingsystem")
for each obj in objset
set os = obj : exit For
next
' this one will do a forced *log off*
' (change EWX_LOGOFF with any of the other Const if needed)
os.win32shutdown EWX_LOGOFF + EWX_FORCE
--
torgeir