question

Jsmith-8844 avatar image
0 Votes"
Jsmith-8844 asked HawksFire-0429 answered

Auto Logoff for inactivity

Hello,

I'm trying to come up with a way on a local workstation to be able to log out an admin if they forget to log off for the day. I was thinking something like 5 minutes of being idle to force user to log off. I went through several forums, including this site, but nothing seems to work. I tried creating a scheduled task and tested it for one minute, but it doesn't work. I also tried using some third party program called "lithnet" and nothing happens after one minute.

This would be for a windows 10 workstation. Any idea on how I could set this up?

windows-10-network
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered DSPatrick edited

You can have your task or script use logoff command.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/logoff

also
https://devblogs.microsoft.com/oldnewthing/20190723-00/?p=102727

--please don't forget to upvote and Accept as answer if the reply is helpful--






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HawksFire-0429 avatar image
0 Votes"
HawksFire-0429 answered

Here is something that logs off any Idle user - it took a while, but take a look :
https://bobby.kearan.net/2022/06/19/log-off-idle-user-with-quser-and-powershell/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.