How to Force Idle Users to Log Off After a Period of Inactivity in Windows 7

Photo of author
Written By Erik

In this blog post, we will teach you how to force idle users to log off after a period of inactivity in Windows 7. This is a great way to keep your computer secure and free up resources for other users. It is also a good way to enforce your company’s security policy. Let’s get started!

Not too long ago we encountered some problem with our users that share PC’s in different locations on our network. Some users do not always log-off their PC’s when they have to go into the plant. Now from where they are on the network, they remote desktop into another workstation for a particular system developed in-house.

Now if a user does not log-off, this remote desktop connection stays logged-in and makes it so no-one else can use that PC. Therefore, I was tasked with finding a way to log a user off if there is no activity for a certain amount of time.

Windows 7 solution to force users to log off after a period of inactivity

I searched on Google and couldn’t find any other Windows 7 solution except this one.

It involves getting hold of the “winexit.scr” screensaver contained in The Microsoft Windows 2000 Resource Kit, or you can read about and download individual resources from this toolkit here.

You simply copy this .scr file into “C:\Windows\System32\”, then this screensaver will be available to select and configure like all the others.

Then you need to ensure that it will work with any user and not only Administrators. This you do by allowing access to a specific key in the registry.

Run registry editor and goto: “HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\IniFileMappings\Control.ini”

Registry editor
Registry editor

Right-click on “Control.ini” and click Permissions.

Control.ini
Control.ini

In the Group or Usernames box, add Everyone, and then click Advanced.

Click Advanced

In the next dialogue box, with “Everyone” selected, click on Edit.

Select Everyone and click Edit
Select Everyone and click Edit

Click the Set Value and Create Subkey check boxes to select them.

Set Value and Create Subkey check boxes
Set Value and Create Subkey check boxes

Click OK, and then click Apply and OK, and then click Apply and OK again.

Close Regedit

This causes the screensaver to work with any user that is logged on.

The last thing to do is to make sure the user does not change the screensaver to another one that will not perform the log-off function. This you need to set-up in the Group Policy Editor.

Group Policy Editor
Group Policy Editor

When you have opened the Group Policy Editor, you go to: “User Configuration -> Administrative Templates -> Control Panel -> Personalization”

User Configuration -> Administrative Templates -> Control Panel -> Personalization
User Configuration -> Administrative Templates -> Control Panel -> Personalization

Set “Screen Saver Timeout” to 300

“Screen Saver Timeout” to 300
“Screen Saver Timeout” to 300

Set “Force Specific Screen Saver” to %SystemRoot%\System32\winexit.scr

Force Specific Screen Saver
Force Specific Screen Saver

Set “Prevent Changing Screen Saver” to Enabled

Prevent Changing Screen Saver
Prevent Changing Screen Saver

Set “Enable Screensaver” to Enabled

Enable Screensaver
Enable Screensaver

Close Group Policy Editor.

Now, when the user has not moved the mouse or hasn’t typed anything in 5 minutes, the PC will be logged off automatically, allowing other users to make use of the network resources otherwise engaged.

Related questions and answers

Below are some short answers to other related questions when it comes to forcing users to log off Windows 7.

How do I force a user to log off Windows 7?

To force a user to log off Windows 7, you can use the net command. Open a command prompt by typing “cmd” into the run dialog box (Windows key + R), and then type the following command:

>net user username /logoff

Replace “username” with the name of the user account you want to log off.

How can I log users off after a period of inactivity?

There are a few ways to log users off after a period of inactivity in Windows 7. One way is to use the built-in Group Policy Editor. Another way is to use a free third-party utility called WinExit.

Also the guide in this article will be able to help you out.

How do I make my computer log off automatically?

You can do this quite easily in Windows 7 by following the steps below:

  1. Go to Start > Control Panel.
  2. In the top right corner of the screen, under View by:, select Large icons.
  3. Click on Power Options.
  4. In the left column, click on Change when the computer sleeps.
  5. Under Put the computer to sleep:, select a time in the drop-down menu that you want your computer to sleep after (for example, 60 minutes for an hour).
  6. Make sure that Turn off hard disk after is set to –Never– .
  7. Click on Save changes.

How do I change the automatic logoff time in Windows 7?

To change the automatic logoff time in Windows 7, you’ll need to access the System Properties dialog. To do this, open the Control Panel and click on “System”.

In the System Properties dialog, click on the “Advanced” tab and then click on the “Settings” button under “Logon”.

In the Logon Settings dialog, set the “Timeout after” setting to whatever value you want and then click on OK.

Summary

In this guide we have showed you how to force idle users to log off after a period of inactivity using a simple step by step guide. We hope this helps solving the issues you are experiencing.

If are interested in other topics like this, visit our general Windows topic page, or our specific Windows 7 page.

Leave a Comment