Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to handle when a computer goes to sleep #41

Open
JustinHoMi opened this issue May 2, 2022 · 9 comments
Open

how to handle when a computer goes to sleep #41

JustinHoMi opened this issue May 2, 2022 · 9 comments
Assignees
Labels

Comments

@JustinHoMi
Copy link

First of all, thanks for publishing this tool.

Question -- I tried using this on a couple of laptops, and have run into an issue. If the user puts the computer to sleep for the night, when the user logs back into the computer in the morning their session will immediately get logged out. I understand why this is happening -- but I'm curious if you have any ideas on how to work around it. Thanks.

@ryannewington ryannewington self-assigned this May 3, 2022
@ryannewington
Copy link
Member

@JustinHoMi

Thanks for reaching out and reporting this. What the scenario you are using idle logoff in with these users, and what do you desire the behavior to be?

@JustinHoMi
Copy link
Author

Well, NIST 800-171 / CMMC is a security standard for federal contractors. One of the requirements is that we log users off after a specified amount of time (it doesn’t say exactly what that time must be). I am testing with 8hrs idle time, since that’s long enough not to interfere with users during the current workday, and short enough that it will trigger before the next workday. I’m flexible with that though.

Since many users just put their laptop to sleep at the end of the day, the preferred behavior is that it would trigger the log off as soon as the laptop comes out of sleep. However, it seems to trigger after the user logs back in to Windows. So, it’s an inconvenience to the user since they have to log in twice. Is it possible to trigger the logoff after the computer wake from sleep, but before the user logs back in?

@ryannewington
Copy link
Member

What you are after is how I would expect it to work. I wonder if its just a race condition where the user is logging in faster than the app is checking the idle interval. I think from memory the app checks idle state once every 30 seconds.

If you wake a laptop and leave it at the lock screen, does it eventually log the user off?

@JustinHoMi
Copy link
Author

Yep! You’re right. If I leave it for a bit then it’ll log the user off.

Since a sleep event will always mean that time has elapsed, is it possible for the app to listen for the wake event and do an immediate check at that point?

Thanks! If this is too much trouble, let me know. I appreciate the help.

@ryannewington
Copy link
Member

Can you try this build and see if it behaves as you expect?

lithnet.idlelogoff.setup.msi.zip

@ryannewington
Copy link
Member

@JustinHoMi how did you go?

@JustinHoMi
Copy link
Author

Sorry for the slow response! It’s only had limited testing, but the behavior seems the same as before.

@stale
Copy link

stale bot commented May 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 23, 2022
@jmartins1
Copy link

"Since many users just put their laptop to sleep at the end of the day, the preferred behavior is that it would trigger the log off as soon as the laptop comes out of sleep. "

I had the same issue, using a similar product called "idlelogoff". In my case, when users log in using their network credentials a script launches idlelogoff and beings to countdown when the computer is idle. The script allows you to assign and control how long a computer must be idle before locking the computer. You can also set this as a local task schedule task to launch at login; but I digress. So, at the end of the day some staff would also place their computers to sleep; closing the lid on their laptops. This would cause idlelogoff continue to run in the background but not notice that the computer was no longer being used. Thus, the computer would remain logged in. My workaround is a follows, this can be done using a local task schedule task or a deployment platform like PDQ Deploy, the free version would work nicely here. Basically, you will create a script and set it to deploy at a given time or after a period of inactive based on the devices network activity. Personally, I use PDQ Deploy and scheduled the script to run automatically at the end of each day. The script runs a windows command to lock the computer. Since a task schedule task can run regardless of the state of the computer (minus off) and can still receive a deployment from an app like PDQ, the script will lock the computer even if the lid is closed. Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants