Re: Force Logoff if Inactive

From: Patrick J. LoPresti (patl_at_users.sourceforge.net)
Date: 11/16/03

  • Next message: Harry Paratestes: "Re: Force Logoff if Inactive"
    Date: 15 Nov 2003 22:30:55 -0500
    
    

    Another possibility:

    The Win32_Desktop WMI class has a "ScreenSaverActive" property. You
    can use WMI events to monitor the state of that property.

    Roughly... You would use ExecNotificationQuery with a query string
    like "SELECT * FROM __InstanceModificationEvent WHERE TargetInstance
    ISA 'Win32_Desktop'". The result of that query would be an
    SWbemEventSource on which you would repeatedly call NextEvent with a
    timeout.

    That call, in turn, would either time out or give you an
    __InstanceModificationEvent (whose TargetInstance is a Win32_Desktop).
    Thus, you have a loop which you can use to keep track of the screen
    saver state, waking up if that state does not change for a while. You
    just need to combine this with a mechanism for logging off the current
    user.

    This idea needs some refinement; e.g., to make the WQL query apply
    only to the Win32_Desktop of the current user. But I believe the
    basic idea is sound.

     - Pat
       http://unattended.sourceforge.net/

    "Harry Paratestes" <harryp@newz-grp-reader.com> writes:

    > Thanks for feedback.
    >
    > Just now I checked out the Scheduled Task Wizard on W2K client. I believe I
    > could do what you're suggesting, but the missing piece to the puzzle is the
    > 'inactivity timer'. Did a little more research on this and it dawned on me
    > that there MUST be an internal clock/process/service/daemon running on W2K
    > that determines inactivity. No surprise here, screensaver and Power Scheme
    > functions [Control Panel/Power Options] obviously are triggered by some
    > keypad or mouse activity timer. Terminal services on W2K Server has
    > inactivity function too (bounces users if not activitely using TS).
    >
    > If anyone has insight on the process/service/daemon that determines keyboard
    > and/or mouse inactivity on W2K and how to exploit it, any guidance or points
    > will be much appreciated.
    >
    > HP sends


  • Next message: Harry Paratestes: "Re: Force Logoff if Inactive"

    Relevant Pages

    • Re: Force Logoff if Inactive
      ... The Win32_Desktop WMI class has a "ScreenSaverActive" property. ... You would use ExecNotificationQuery with a query string ... > that determines inactivity. ... No surprise here, screensaver and Power Scheme ...
      (microsoft.public.windowsxp.security_admin)
    • Re: Force Logoff if Inactive
      ... The Win32_Desktop WMI class has a "ScreenSaverActive" property. ... You would use ExecNotificationQuery with a query string ... > that determines inactivity. ... No surprise here, screensaver and Power Scheme ...
      (microsoft.public.win2000.security)
    • Re: Force Logoff if Inactive
      ... The Win32_Desktop WMI class has a "ScreenSaverActive" property. ... You would use ExecNotificationQuery with a query string ... > that determines inactivity. ... No surprise here, screensaver and Power Scheme ...
      (microsoft.public.security)
    • Re: Force Logoff if Inactive
      ... I want the locked screensaver to come on ... unlocks workstation or 24 hours of inactivity ... >| off lusers after timeout has expired? ...
      (microsoft.public.security)
    • Re: Force Logoff if Inactive
      ... I want the locked screensaver to come on ... unlocks workstation or 24 hours of inactivity ... >| off lusers after timeout has expired? ...
      (microsoft.public.windowsxp.security_admin)