Kaseya Community

Logoff Inactive Users

  • Logout Inactive User.zip
    Been looking for a solution to target specific machine that can log off inactive users after a period of time without having to make policies on the network. The problem I keep running into is users will login and later go home at the end of their shift without a logout. Screensaver locks the session and no one else on the next shift can use the machine. Hard rebooting is not desired. Since it only happens on specific machines, a GPO attempt would interfere with other users that need apps open all the time. Some machines are in a domain, some are in a workgroup, some are stand alones.

    I made changes to the Registry in trying this out, but found c:\window\control.ini is where the winexit settings are.

    Try it. If it does not work, the instructions for the regedit are in the scripts comment area.

    This will set the screensaver to 15 minutes. After 15 minutes, a warning pops up showing a 30 second logoff warning and allows the user to cancel it.

    You need to run this script with each user is logged in one time, so the screen saver is set for that user, OR, you can manually go set the screensaver to WinExit. If you have a situation where users rotates, just schedule the script to run every 4 hours or so to catch each user. Works like a charm.

    One catch tho that I have not been able to resolve yet. On the machine in question, you need to manually change the permissions in the registry so EVERYONE in the domain can have R/W to control.ini. This is explained in the TID link.

    I have been trying to get SETACL or SUBINACL to set the registry permissions for control.ini via a K script, but have not been able to get it working yet.

    Any assistances is appreciated.

    Legacy Forum Name: Logoff Inactive Users,
    Legacy Posted By Username: shickey
  • That is pretty damn cool. Thanks!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: SMason