I got a question from Tracy this week:
“Hi Steve. Love all the tools and tips you keep sending our way. Got a question. Is there any easy way to logoff a user when they are not active for say, 15 Minutes?”
I spoke with Tracy further to explain that forcing a logoff could cause data loss.
For example, a user has a Word document open and they walk away. Then boom the forced logoff happens and their document is gone.
In her case she needs it for public facing kiosks. If one of the technicians walks away, it leaves the system wide open.
Locking the workstation for this situation is bad too – since it makes it so the customer cannot use the machine.
Did some googling and found some hacks that used chopped up screen savers that would activate, and then call some logoff code.
Didn’t like that. So I had the team build a little app that would just logoff or lock idle users.
Here is how it works, you call the program like this:
idlelogoff.exe [timeout] [action]
timeout - The number of idle seconds before the action is taken
action - [logoff / lock / shutdown] You can lock, log the user off, shutdown or restart the workstation.
If you wanted a user to get booted off after 5 minutes (300 Seconds) of no activity, You would call it like this:
idlelogoff.exe 300 LOGOFF
If you wanted it to lock the workstation after 30 seconds of no activity this would do the trick
idlelogoff.exe 30 LOCK
If you wanted it to shutdown the workstation after 30 seconds of no activity this would do it:
idlelogoff.exe 30 SHUTDOWN
It has some sanity checking for the timeout. Anything less than 10 seconds is set to 10 seconds.
Call it from the users startup script to make sure it is active while they are logged in.
Get it from our downloads page:
http://www.intelliadmin.com/index.php/downloads/
It is free for personal and commercial use.
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools
{ 50 comments… read them below or add one }
← Previous Comments
@Jordan
Create a new OU with only the computers you want this applied to. Then create a new Group Policy and link the OU to the GP. Still create it as a logon script though under user config.
One quick question though. I have this setup using group policy so the .exe is copied from a server, to the C:\. Then a shortcut of the .exe is placed in the startup folder with 1800 LOGOFF. However, when the machine logs in, I am prompted for approval to run this software. Can I run this silently? I have tried .exe /S 1800 LOGOFF but it looks as thoug the software does not load at all with this command.
Thanks
@Colin
Try placing the .exe under “All Users” in the Documents and Settings folder on C:. Are you running a batch file? This application wont run correctly as a startup script so you need to create a batch file and use it as a logon script. Once there just try
START Idlelogoff.exe 30 logoff
@Colin
Try placing the .exe under “All Users” in the Documents and Settings folder on C:. Are you running a batch file? This application wont run correctly as a startup script so you need to create a batch file and use it as a logon script. Once there just try
START Idlelogoff.exe 30 logoff
Hi Jeremy,
The approval message is not coming from our program…but from windows. I suspect it is the same machine you downloaded it from…I think on other computers it should not ask you for approval since it is signed with our certificate.
Thanks,
Steve
I just tried copying the .exe and renaming it so I have logoff.exe & lock.exe. I created two batch files and ran them in succession, and the second batch file is the one that actually works.
I watch my list of processes with Task Manager, and can see “lock.exe” appear on the list, then it disappears when I ran my second batch file, and “logoff.exe” appears.
not working for me 🙁
tried to run from dos (windows xp home sp 3 , local language),
The NTVDM CPU has encountered an illegal instruction.
CS:1199 IP: 037f OP:2e 63 6f 6d 2f
choose “close” to terminate the application
Sounds like your download was corrupted. I would try downloading it again..and it should work
@29 tested, nice tool with lots of options. not free, but hey choice is good.
Im attempting to use this utility within a Citrix envirnment to lock sessions after 15 min. I’m launching the utility from a logon script with the paramater to lock the computer after 900 seconds. We need this to lock published application sessions (vs. published desktops using screen saver). This functionality works great except that having the idlelogoff.exe process active when a user goes to log out from a published application session is preventing the session from being closed properly. I added idlelogoff.exe into the locoffchecksysmodules registry string value but no dice. (http://support.citrix.com/article/CTX891671) I opened a case with Citrix on the problem and they had me collect process dumps and a full system dump. They looed at the dumps and are saying that the application is waiting on a post quit message. Can an update be made to make this utility close gracefully in my scenario? I apreciate any help you may be able to provide and thank you for your efforts in making this usefull tool!
Hi Hilary,
Any idea what message is sent to apps when the session ends? Normally a post quit message is sent on logoff.
Thanks,
Steve
It would be super awesome pretty pretty please to have an option for this to spawn an arbitrary command in the Windows console environment 🙂 🙂
For example the ACTION options could be [logoff / lock / shutdown / command ].
And/or it would be awesome to know the source code that comprises this wondrous tool, that I may so adapt it for said purpose.
Hi McGreedy,
That is an interesting idea. We will look into it for the next version. Unfortunately we cannot make the source available. It uses our internal API which is used for line of commercial products.
Thanks,
Steve
This is a fantastic option. I have been using a bunch of different screensaver options and they are a nightmare. They need registry changes to at least function inconsistently.
Currently testing it for deployment. My only gripe is there isn’t an option to give a user a chance to cancel.
Typically my users logs in for five minutes and then takes off to log into another machine for one reason or another. If the off chance they are standing in front of the computer picking there nose for 5 minutes; I would like to give them a chance to cancel the log off. A little pop up that tells them they have a minute to cancel the logoff would be nice.
Thanks Steve,
Is there is was to use it for a specific user?
Is it a kind of check which keeps checking the status and take action once we run it?
Steve,
I am trying to set up idlelogoff to run as a service, using srvany, but cannot seem to get the command paramters to work (paramters being used are: 180 LOCK. Any insight would be appreciated.
Thanks !
Hi James,
I don’t think that will work. The problem with running it in the service context is that it won’t have access to the users desktop. It is possible to run from a service, but it would have to be carefully constructed to watch the desktop session and then unload and reload the program if the session changes.
If you are looking for a way to keep users from getting rid of it, you could use a group policy logon script…just make sure it is a user policy and not a computer policy…that way it runs in the user context.
Steve
So we are looking to use something like this in an educational lab environment. Currently, we have our screensaver set so that after 15 minutes, it locks the screen.
We want to have it log the user off after 30 minutes of no activity, as long as they are not ‘rendering’ images in 3d-studio, or other CAD applications.
So what is the definition of ‘idle’? No keyboard or mouse input for X # of minutes?
Could this program be modified so that it will only log the user off if the CPU is also Idle? (or very little usage)? Typically when a user sets up a rendering job, it could run for 18 hours, and we don’t want it to log the user off if the CPU is processing a render job. Perhaps adding a setting for it to only log off the user if CPU usage is less than a specified % for a specified amount of time…
Is it possible to get the program to lock after 30 seconds, logout after 15 minutes and shutdown after 1 hour?
Idle is defined as Mouse or keyboard activity.
Using CPU usage will always be problematic…since every computer handles this differently.
For example, on an older PC a program might take 10% CPU time on average.
On a new, high end system it might bounce around 1%~0%
The problem now is that you would need to tweak this for every system.
I don’t think it would be too hard for us to add CPU% for X minutes then do Y…but you would just need to test and make sure it works for your situation.
Will the following command work in our logon.bat?
\\domain.local\netlogon\ifmember /v “domain\Agents” start \\domain.local\netlogon\idlelogoff.exe 600 LOGOFF
Or, do I need this executable to reside on the local drive of the machine and perform start c:\windows\idlelogoff 600 LOGOFF as an example?
This worked great. Just what I needed. This is super easy to setup.
I dropped the idlelogoff.exe into the root of C:/
Go to “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup” and create a batch file.
To do this, open a notepad and enter the following:
START C:\idlelogoff.exe 300 LOGOFF
You can change the syntax for whatever process you need to run. Save the file as a .bat file and move it to the directory above.
Log out and back in to test. 5 Minutes of Idle time and you now get logged out.
What is the maximum timeout I can use before logout? I’ve tried using 172800 seconds (should be two days?) and after 3 days I was still logged in.
My question is similar to #18 of Ben above. I wanted to test it as a lock first followed by a logoff. I put in as idlelogoff.exe 30 LOCK followed by idlelogoff.exe 60 LOGOFF. The first command appears to have run fine as the unit locked after 30 seconds, but the 2nd instance never fired off. I figured that if only one of them would have executed, it should have been the second instance replacing the first but this was not the case. How would more than one instance of this be able to be used to complete more than 1 task (a lock, followed by a logoff)?
Thanks
Barring being able to use 2 instances, I did manage to accomplish what I wanted doing it the following way:
1) GPO User policy to set a screensaver to launch after a specified time and password protect it.
2) An instance of idlelogoff running in the background from GPU user logon script with the specified amount of time to logoff after the screensaver kicks in.
This gives the user a certain amount of time after the screensaver kicks in to log in without losing anything.
How about to extend the program to run a batch file after idle timeout?
LogOff, Shutdown and Lock are great options, but can this tool “Restart” the PC as well?
Thanks.
H. Bayat
Hello Hossain,
Sounds like an interesting idea. We might add this in the next version.
I agree – please add RESTART
Another vote for RESTART!
Hello Everyone,
Here is a new version with the restart option:
http://ftp.intelliadmin.com/release/idlelogoff.exe
Let us know if you run into any problems by sending an email to support@intelliadmin.com
Thanks for the effort on the RESTART
This is for someone looking for a detail information of deploying it using GPO on a domain controller.
1. download the application i.e. idlelogoff.exe
2.Create a folder e.g. idlelogoff
3. Put the file you just downloaded into the folder.
4. create a batch file using notepad to call the program you downloaded. e.g., “start c:\idlelogoff\idlelogoff.exe 300 LOGOFF/RESTART/ETC (Make your choice)
5. Share the folder you just created to everyone/specifically (make your choice)
6.Create an OU and place the computer you want it to apply to the OU.
7. Go to group policy and create a gp e.g., idlelogoff and link it to the OU you just created.
8. Edit the gpo from computer configuration>Admin templates>systems>Logon, choose Run these programs at user logon and put the file directly e.g., c:\idlelogoff\idlelogoff.exe
apply it.
9. From the user confi, select Policies>Windows settings>scripts(Logon/Logout), double click logoff and specify the path that contains your script you wrote, e.g., c:\idlelogoff\script
Hope that helps someone.
Idlelogoff.exe 20 LOCK
This locks the computer when i’m watching movies and that is a problem. How can I solve this?
What is the maximum timeout?
Hi. Is there a way to cancel this. Say I want to start a huge download and the logoff timer is ticking, would be great to be able to send a command, maybe: idlelogoff.exe 0 CANCELALL
or… will it work to ENDTASK idlelogoff.exe?
Suggestion for the tool
1st Suggestion
Add a Message box to the user whats going on
Example idlelogoff.exe 300 LOGOFF Message: AUTO LOG OFF, 60 SEC TO SAVE YOUR WORK!
2nd suggestion. Write to the even viewer so when users say it crashed the eventview tells the admin the PC shutdown or logoff because of the PC was not active.
3rd, Give the user a message that the PC is about to log off, give the user an option to stop the log off process.
Example I happen to be doing email on a 2nd PC, the message may remind me to get back to work.
Hello,
I am curious as to whether or not you can create a scheduled task with this .exe file without having to call from a batch file.
The other way matt would be to kill idlelogoff.exe
That does sound like a good feature to add. I will put it on our list.
Hi Dan,
I believe it may be the maximum 32 bit signed integer. This would be around 2 million seconds. Which is about 500 days.
Hi Ture,
I don’t know if there is a way for us to detect this. Usually when a program goes full screen it takes the action to disable the screen saver. It is not going to ‘know’ about idle logoff. So really in this situation idlelogoff is not going to be a good solution.
Can anyone confirm that idlelogoff.exe does not work when explorer.exe is not running? Running thin clients in kiosk mode, and I’m not able to startup idlelogoff.exe automatically.
This is a great little utility!
Will idlelogoff work for a situation where there are multiple users logged in? We tend to have more than one person using each PC during the course of the day and of course they do not log out when they are done. So we sometimes wind up with 10 or more users logged into a PC simultaneously.
If each user has a logon script that launches idlelogoff of course that will result in multiple copies active with each user having his/her own idlelgoff process. Will this work OK?
I just wanted to say thanks for a great product.. and share how I use the product in our company (about 1000 pc’s)
I create a bat file named GMG-logoff.bat and rename idlelogoff.exe to GMG-logoff.exe. I then placed the 2 files together in a folder and used bat2exe to create a new .exe..
I then push this .exe to all pc’s I want it installeld on in the public “all user” startup folder.. so each user that logs in to the PC will have it running.. I also have it set to 6 hours, this way it forces all users to log off every night..And any user that switched user and forgot gets logged off without the other logged on user even knowing about it!
I then noticed that because of the bat2exe creation, every time it was launched it would create a temp folder with a new instance of the file..
So I had to create a new .bat file and added more code to the new file named logoff.bat that keeps the temp folder clean of these temp files/folders..
I then placed all 3 files (and an ico file) into a folder and recreated a new .exe with bat2exe, this new file GMG-logoff.exe is then pushed to all PC’s that it is needed on to the Public “all user” startup folder..
Just thought I would share..
Again thanks for a great product!
The bat files I use..:
1st file GMG-logoff.bat
includes:
start logoff.bat
++++++++++++++++++++++++++++++++
2nd file logoff.bat
includes:
Echo off
cls
set mypath=%cd%
set mytemp=%temp%\7ZipSfx.000
set mytemp1=%temp%\7ZipSfx.001
if %mypath% == %mytemp% (goto :process)
if %mypath% == %mytemp1% (goto :process2)
RD /S /Q %temp%\7ZipSfx.001
RD /S /Q %temp%\7ZipSfx.000
START GMGlogoff.exe 21600 logoff
goto :end
:process
if exist “%temp%\7Zipsfx.001” (RD /S /Q %temp%\7ZipSfx.001) else (goto :start)
START GMGlogoff.exe 21600 logoff
goto :end
:process2
if exist “%temp%\7Zipsfx.000” (RD /S /Q %temp%\7ZipSfx.000) else (goto :start)
START GMGlogoff.exe 21600 logoff
goto :end
:start
START GMGlogoff.exe 21600 logoff
:end
exit
I have some users that log into a Win7 VM remotely. They frequently just close the terminal session instead of logging out. Would this work for them also?
They are just logging in and using a database application so not active unsaved data.
That I am not sure of. The best way would be to give it a shot
If you are watching a video (youtube in window, not maximized) without touching the mouse or keyboard, idlelogoff will count that as inactivity and log you off. Is there a fix for this?
Steve
I’m testing this at work; it would be perfect for our Pharmacy users who bounce from pc to pc all day. However we are in a locked-down environment, and in my testing it only works properly if the user is a local Admin. It doesn’t log off non-Admin users. Any way to get this to work for non-Admins?
Thanks
Nick
Hello Nick,
It should work fine for non-admin accounts. We will have to do some testing here and see what is going on. It could be that the account needs a specific right to send the logoff command.
It may be we need to call a different api to do this.
Hello Dano,
idlelogoff only looks at mouse and keyboard input. It has no knowledge of what is running currently. This is something we need to look at in a future version. Thanks!