Subscribe
Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.
Recent Posts
- Avoid the Windows 10 Anniversary Update!
- Windows 10 free upgrade ends today
- Remote Control Enterprise 5.6 Released
- Remote Control 5.6 Released
- Prevent the Windows 10 Download
- Remove the Windows 10 upgrade nag message
- Automatically reboot idle computers
- Enterprise Remote Control Update
- Convert Hyper-V to VMWare
- Utility to clean out temp files
- Easy solution for “Cannot delete “file name”: The file name you specified is not valid or too long.”
- Windows flaw found – Make sure you patch today
- Burn files from the command line
- Enterprise Remote Control – Security Update
- Shutdown or reboot computers remotely
- The next version of Windows – Windows 10
- Shellshock – A vulnerability to look out for
- Power up computers remotely
- New tool from SysInternals – SysMon
- Enterprise Remote Control Security Update
- Free Backup Software for Hyper-V
- Free Networking and Windows Server Tutorials
- Turn virtual machines on and off from a script (Hyper-V)
- Remote Control 5.4 MSI Distribution
- Remote Control 5.4 Distribution Update
- Boot Windows 8 from an external drive
- Remote Control 5.4 Released
- Microsoft’s best kept secret – EMET
- Force Automatic Updates – Part 2
- Remote Control Beta 2 Released
- Clean up temp files remotely – Version 2
- Enterprise Remote Control – Security Patch
- Beta – Remote Control 5.4
- Important Security Mailing Lists
- See if a program “phones home”
- Security for virtual environments
- Windows XP Support Nag Window – FYI
- Tabbed folder view for Windows
- Free IT Training materials
- USB Disabler Pro Released with Free Edition
- Block Flash Drives, Phones, and Removable Media
- Free Windows Server 2012 R2 EBook
- Cleanup temp files remotely
- A simple IP Scanner for Windows
- Enterprise Remote Control Update
- Delete temp files from all user profiles
- Execute Defrag Remotely
- Cleanup Automatic Update Files Remotely
- Command prompt replacement for Windows
- Find your Windows 8 Product Key
- Show network activity in the system tray
- New build of Enterprise remote control released
- Network Administrator Update – IE Blocker Fix
- Prevent an Internet Explorer 11 automatic install
- Free tool to remotely manage Hyper-V
- Burn a DVD or CD from the command line
- Free backup utility for virtual machines
- Remove offline printers using vbscript
- Enterprise Remote Control Released
- Activity report for Windows – See what a user has been doing
- Sprinkler system controlled by a Raspberry Pi
- Disable cloud features in Office 2013
- Enterprise Remote Control – Final Beta
- Secure the Google Chrome Web browser using Group Policy
- Enterprise Remote Control – Users Guide (Rough Draft)
- A free tab based remote desktop tool
- Enterprise Remote Control Beta Released
- Remote support without the monthly fees
- Get the dell service tag remotely
- A simple utility to help users print system information
- A Windows 2012 RDP Shadowing Alternative
- The NSA Guide to finding private information on the Internet
- Get a Network Information Tool for Windows
- Block IE 10 – Keep it out of automatic updates
- Remote Control Online Beta 4
- The Internet in 1995
- Software to help you free up hard drive space
- How to refresh group policy remotely
- Remove unwanted programs easily
- New version of SystemInfo.exe Released
- Import a .reg file remotely
- How your users can easily report their system information to you
- How to list all USB devices on your network
- Remote Control Online Beta 3
- Force windows updates remotely – even when WSUS can’t
- Enable File and Printer sharing from a script
- Add a domain group as a local administrator from a script
- Find files quickly in Windows
- File and Drive Defrag Tool – UltraDefrag
- Peek around your network with a free utility
- Free Virtualization Software
- 10 Free E-Books from Microsoft Press
- Remote Control Online Beta 1.1
- Free E-Book – Windows 8: An overview for IT Professionals
- Remote Support over the Internet
- Windows 8 – Enable the Admin Share
- Set wireless settings from a script
- Manage automatic updates from the command line
- Easily disable file encryption
- Spy on computers remotely
Search
Archives
- August 2016 (1)
- July 2016 (1)
- May 2016 (2)
- February 2016 (1)
- July 2015 (1)
- March 2015 (3)
- February 2015 (2)
- November 2014 (2)
- October 2014 (3)
- September 2014 (3)
- August 2014 (3)
- July 2014 (3)
- June 2014 (1)
- May 2014 (3)
- April 2014 (4)
- March 2014 (4)
- February 2014 (4)
- January 2014 (4)
- December 2013 (3)
- November 2013 (3)
- October 2013 (4)
- September 2013 (4)
- August 2013 (1)
- July 2013 (5)
- June 2013 (3)
- May 2013 (5)
- April 2013 (4)
- March 2013 (5)
- February 2013 (3)
- January 2013 (3)
- December 2012 (2)
- November 2012 (4)
- October 2012 (4)
- September 2012 (4)
- August 2012 (5)
- July 2012 (3)
- June 2012 (5)
- May 2012 (4)
- April 2012 (4)
- March 2012 (4)
- February 2012 (5)
- January 2012 (4)
- December 2011 (4)
- November 2011 (5)
- October 2011 (4)
- September 2011 (5)
- August 2011 (5)
- July 2011 (4)
- June 2011 (4)
- May 2011 (4)
- April 2011 (4)
- March 2011 (5)
- February 2011 (2)
- January 2011 (4)
- December 2010 (4)
- November 2010 (3)
- October 2010 (5)
- September 2010 (3)
- August 2010 (5)
- July 2010 (5)
- June 2010 (5)
- May 2010 (5)
- April 2010 (2)
- January 2010 (1)
- September 2009 (4)
- August 2009 (4)
- July 2009 (5)
- June 2009 (9)
- May 2009 (8)
- April 2009 (3)
- March 2009 (1)
- February 2009 (2)
- January 2009 (7)
- December 2008 (11)
- November 2008 (21)
- October 2008 (10)
- September 2008 (1)
- August 2008 (2)
- July 2008 (12)
- June 2008 (3)
- May 2008 (3)
- April 2008 (4)
- March 2008 (3)
- February 2008 (8)
- January 2008 (7)
- December 2007 (7)
- November 2007 (17)
- October 2007 (23)
- September 2007 (19)
- August 2007 (25)
- July 2007 (2)
- June 2007 (11)
- May 2007 (1)
- April 2007 (6)
- March 2007 (6)
- February 2007 (6)
- January 2007 (10)
- December 2006 (23)
- November 2006 (35)
- October 2006 (8)
- September 2006 (6)
- July 2006 (4)
- June 2006 (8)
- May 2006 (7)
- April 2006 (14)
- January 2006 (20)
- May 2005 (1)
Automatically logoff inactive users
[画像:Post image for Automatically logoff inactive users]by Steve Wiseman on November 16, 2011 · 100 comments
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.
MS Word in the trash
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%7円ZipSfx.000
set mytemp1=%temp%7円ZipSfx.001
if %mypath% == %mytemp% (goto :process)
if %mypath% == %mytemp1% (goto :process2)
RD /S /Q %temp%7円ZipSfx.001
RD /S /Q %temp%7円ZipSfx.000
START GMGlogoff.exe 21600 logoff
goto :end
:process
if exist “%temp%7円Zipsfx.001” (RD /S /Q %temp%7円ZipSfx.001) else (goto :start)
START GMGlogoff.exe 21600 logoff
goto :end
:process2
if exist “%temp%7円Zipsfx.000” (RD /S /Q %temp%7円ZipSfx.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!