lithnet/idle-logoff

Option to wait for activity before starting ide counter

nascentt opened this issue · 10 comments

This tool seems like the perfect thing for logging out users on a kiosk after idle. however, as the kiosk would have Force Auto Logon, it means the account will be logged in without a user necessarily being there. So have it logoff on 30 minutes of idle will mean it continually logs off every 30 minutes.

It'd be great to have an option that the program will wait for some activity first and then start waiting for idle from that point. Thus only logging off the kiosk user if they've actually used the kiosk.

Is there any chance of getting such an option?

Hi @nascentt.

It's a bit tricky to do with the app itself, but could you perhaps use a logon message, to delay the autologon process, so the user has to click 'ok' before starting the session. I think this would prevent idle logoff from loading until they interacted.

https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/interactive-logon-message-text-for-users-attempting-to-log-on

It's a bit of a long way around, but the only option i can think of.

Appreciate the response!
Alas, I cannot do an interactive logon in this case. The requirements are an always-at-desktop kiosk.

I was just hoping for an option like "if active within the last _____ minutes"
but as you get the idle count from the windows api I understand why that'd be tricky.

Fair enough. Try this build with a new option in the settings screen. It's the only way I can think of to do something similar to what you are after, but you will need to test it and see if it works for your scenario.

lithnet.idlelogoff.setup.msi.zip

This looks incredible. Thank you so much.
I'll test it over the next few days.

Apologies for not replying for a week, things have been absolutely crazy! I finally got some time to use and test this and it is exactly like I was hoping!
Thank you so much for adding the functionality.

As requested. It's not logged me out after being left idle for longer than the user session which is exactly what I asked for!
There does seem to be a period of time after logging on where I can interact with the pc and let go and the idle action/prompt never shows up. But If I wait a couple of minutes, then use the pc and let go, indeed the prompt shows up and I can dismiss (move mouse) or let it logoff, and there's no logoff loop afterward despite being left idle for hours. I tried to diagnose bit but there doesn't appear to be any logging (it'd be cool if you could output to a log!).

I presume there's a time buffer when the process starts before the idle countdown kicks in to prevent a risk of triggering too early or something? If so it may need to be reduced.
It's not a deal-breaker though, and is absolutely usable the way it is.

Thanks again for listening to my request and implementing it!

There's no buffer, it just depends on when windows actually starts the app.

When the app starts it asks windows for the timestamp of the last user interaction, and only starts measuring idle time once that value changes.

So if windows doesn't start the app for 60 seconds after login, you've got 60 seconds to input that the app isn't going to know about.

Yup, that makes sense. It doesn't really cause any issues or act as a deal-breaker in any way. Someone using the mouse and keyboard for the very first 60 odd seconds and then walking away isn't really a big risk, there's only so much they can actually do.

Thank you again so much. It's fantastic.

Not so be too greedy, but it would be nice to get some very basic logging (eg a timestamp of when it logs users off) not just for debugging, but also accountability in case users report interruptions. would that be possible? should i post a separate issue/request? Whether it be to the event log, or a text file we could point somewhere.

Let me know if there's somewhere I can donate for you great support.

You are welcome.

The app logs to the application event log for all actions taken.

Ah I should've checked, I didn't see it mentioned so just assumed it wasn't available.

Well, thank you again for the great support and program.

No problems at all!