Force a user logout when a machine has been locked for a specified period of time

Hi, today I will talk a small tip to force a user logout when a machine has been locked for a specified period of time.

The specific question I seen that I want to answer was;

There are machines in a shared lab. Sometimes someone will lock the machine with the intention of coming back, but for whatever reason they do not. Currently the machine is powered off so another user can use it.

What would be nice would be to set a timer, say 20 minutes, then have a button display that could allow the next user to claim the machine. It should logout the current user and present the login screen to the next user.

Is there a Group Policy setting or perhaps some other means (Windows Credential Provider) to force a user logoff when a machine has been locked for a specified period of time?

That small tip is handy for internet cafe or in any case where there is shared computer.

First of all, in a case of shared computer, a local administrator can force a logoff or a normal user can switch the user in that windows with the option switch user

For it’s a workaround, but it would be to create a local planned task with a on idle trigger with a 30 minute condition and the task will run shutdown /l







If someone wonder if the tip will happen if someone watch a movie, and the computer is not locked, then we can validate on technet, and no, as;

Task Scheduler checks for an idle state using two criteria: user absence, and a lack of resource consumption. The user is considered absent if there is no keyboard or mouse input during this period of time. The computer is considered idle if all the processors and all the disks were idle for more than 90% of the last detection interval.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s