Sign in to follow this  
Followers 0
jp10558

Idle logout - LogMeIn software breaks this?

4 posts in this topic

#1 ·  Posted (edited)

I've adapted a script from the forums to log out users after being idle for a period of time. This works as expected when using on a PC directly, even when the user has locked the PC and walked away. But if the user was remotely accessing the PC with LogMeIn free, and kills the browser window, it locks the PC (as expected), but does not ever log out - unlike if locked locally...

Any ideas? This is on WinXP SP3 with the latest LogMeIn Free 2.x...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=server.ico
#AutoIt3Wrapper_outfile=IdleLogout.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
 Author:         James Pulver

 Script Function:
    Idle logout for Virtual Servers .

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#Include <Misc.au3>
#include "E:\Test AutoIT scripts\public\IsPressedEx_UDF.au3"
#Include <Timers.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode",1)
;HotKeySet("+{ESC}", "_Exit")
Switch $cmdline[0]
    Case 1
        $sTime = $cmdline[1]*60000
        MsgBox(0,"Idle Auto-logout","This system will automatically log out users after "&$cmdline[1]& " minutes of idle time.",30)
    Case Else
        MsgBox(0,"Demo Version","This is just an simulated version of the Idle Program." & @CR & "It will display a message at 10 seconds, then wait 15 seconds" & @CR & "and finally automatically log-out the workstation." & @CR & @CR & "To use this in a production Mode:" & @CR &"from the command line type the following:" & @CR & "Idlewindows.exe {time in minutes} before idle expiration." & @CR & "To exit the program hold the SHIFT and ESC keys.")
        $sTime = 10000
EndSwitch
$sBkColor = PixelGetColor (20,20)


while 1
    Sleep(1000)
    $iIdleTime = _Timer_GetIdleTime()
    If $iIdleTime > $sTime Then
        GUICreate(" ",@DesktopWidth,@DesktopHeight+20,1,1)
        GUISetBkColor($sBkColor)
        GUISetStyle($WS_POPUPWINDOW,$WS_CAPTION)
        GUISetState(@SW_SHOW)
        $ichoice = MsgBox(262144+1+256,"Workstation Idle Time Exceeded","Press the Cancel button to stop workstation lock.",15)
        If $ichoice = 2 Then
            GUIDelete()
        Else
            Shutdown (4)
            GUIDelete()
        EndIf
        
    EndIf
WEnd
Func _Exit()
     Exit
EndFunc
Edited by jp10558

Share this post


Link to post
Share on other sites



Microsoft has a screensaver that will log out the PC when it comes up. (Going off of memory here - you will have to search for it.)

Hmmm... Does that override a locked computer though?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0