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 }
Thanks you Steve! Can’t believe you guys built this. I never expected that at all.
Already tried it on a few of our machines, and it is working great so far.
Hi-Some of us are still learning. Instead of saying “Here is how it works, you call the program like this:”—how about providing a real example? Some kind of script–or—?
Thanks!
Hello Richard,
A BAT script would look just like the above examples. Create a file called logon.bat and then inside it you would have this:
idlelogoff.exe 30 LOGOUT
This assumes that the logon.bat is in the same folder as idlelogoff.exe
Thx for the freebie.
Can you explain what constitutes an an active session? keyboard, mouse, display changes, etc?
Had you considered pointing Tracey to more elaborate soutions such as transparent screensavers or MS
Steady state (or the like)?
Active session = Keyboard or mouse movement. If the user does not move the mouse, or type on the keyboard it is considered idle.
Steady state, and the screen saver would both work in this situation as well…but if my memory is correct I believe the last time MS came out with a logoff screen saver was with the Windows 2000 resource kit. Not even sure if it works with the newer versions of Windows.
HI all,
Is there any script that enforce the system shutdown while idle..I tried with windows schedule but this some time works and some time doesn’t work..If any scrips please share it.
thank you,
PUli.
You know Puli….this little program of ours could be updated to do just that…hmm. I will look into it and see how hard it is to add a RESTART and a SHUTDOWN action.
This is awesome!
Not to complicate things; but perhaps a little timer somewhere to display in how much time the computer will be logged off, kind of a visual warning in case your sitting there and waiting for something, but dont really want to logout. Of course you can always set the screen saver a few minutes prior to the logoff……
…..and
RESTART and a SHUTDOWN would be and excellent additon +1 that.
hi, is it possible to run this as a service? because when I launch this via a batch file, it will only work if the batch command window stays open…and if the user closes their application, and where the session would normally log off and close, it doesn’t, due to the batch window being left open, i think…any help would be greatly appreciated, as I might just be doing something wrong. thanks,
Hi there Scott,
Looks like it was a bug. It tries to attach to the console, even when running…so in some situations if the bat file is closed, it will close too.
Download it again and it should work…should have a date stamp of 12/8/11
Let me know if this fixes it for you. Thanks!
excellent, thanks allot…will do :).
Hi steve, the timed shutdown was what i was looking for when someone mentioned it in the responses: has it been updated now? You know around here it takes time to download minor MB because of the average speed of 7 Mb\s, take for example an overnight download can averagely avail about 200 MB only. That is africa for you! So for downloads not up to that and will like my pc to go off at a specified time, how good to have this idlelogoff do the same. thanks for the freebies.
Hello Sesan,
So sorry I forgot about this. I just went in and updated the code, and uploaded the new version to the website. Make sure the banner shows v1.1 when running it from the command line (To be sure you have the new version).
If you downloaded the earlier version, make sure you clear your download cache.
It seems you cannot run this with an account other than the account that is currently logged in. I need to run this so the users cant go in and kill the process. Is there a way for this to be done? Thanks!
v1.1
With this version it is not possible. We would need to re-design it as a service…have it look for users that are logging in…and then finally reach into that session and execute the program.
What about using group policy to restrict access to task manager?
I suggested that to my Lead however, we need to provide them with the option to kill processes that they own. Everything else is locked down.
One trick I use in these situations is rename the EXE to make it harder to find. For example, you could call it svchost.exe They would have a heck of a time finding it in task manager…but not sure if some AV software will think it is a virus then.
hmm…we can give it a shot..thanks again…this program is a lifesaver either way!
This is very interesting. I have an issue with Terminal Server users whom never log off. Could this be used for logging off individual TS sessions after a stated period of inactivity? Thanks!
hey Steve,
awesome application
Just wondering if there was a way of allowing the user to cancel the log off.
we have an educational lab environment where students may be logged in but spending time with their attention directed else where but still using the workstation.
Hi Shane…no. The only way to cancel is to kill the process.
It should work for a TS session. There are cases where a TS session is still logged on but ‘frozen’ This usually happens when a user simply closes their RDP client without logging off…in that situation I don’t think it would work.
Will anyone provide me more details on how exactly you’re deploying this through GP? Are you deploying it through Computer Config (Startup) or User Config (Logon)? I can get it to run at startup (confirmed running process in task manager) but it doesn’t do anything. Either the parameters (300 LOGOFF) aren’t getting passed or I have a permissions issue.
Thanks,
Jordan
After RTFMing again I realized that this would probably only work when deployed as a user logon script and not a computer startup script. It’s now working very well for me that way. However, we’d really like to be able to deploy this only to certain machines regardless of who logs on, i.e. only to a public computer lab. Anyone know of a clean way to accomplish this. Maybe as a scheduled task?
Steve – Excellent app! You may want to change your text above from “Call it from the users startup script…” to “Call it from the users logon script…”
Hello Jordan,
This script would need to run under user config..otherwise it would not run in the correct context…and probably would not be able to log that user off.
Any way to stack this to accomplish the following:
Idle for 15mins = logoff
Idle for 30mins = shutdown
Thanks!
Hi Andy,
You would just need to call the app twice. Like this in a bat file:
start idlelogoff.exe 900 LOGOFFstart idlelogoff.exe 1800 SHUTDOWN
The ‘start’ command allows the app to start, and the bat file won’t wait for it.
Nice free command line tool! For an group policy based alternative with more options you can take a look at AutoLogoff. http://wizardsoft.nl/autologoff/autologoff.html Don’t know if this is appreciated and if deleted.. it’s ok.
This tool is great.
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
I have had the .exe pushed to all my machines. I also pushed a batch file that contains the following.
@echo off
cd C:\Program Files\RISALO
RISALO.exe 14400 logoff
I am currently using as a logon script which starts the process fine but will never actually logoff a user. If I can the batch file manually it works just fine. Any thoughts?
-J
When you launch the process from the logon script…I want you go into the task manager. Who owns the process? Is it the currently logged in user, or system?
Thanks,
Steve
Its the currently logged in user.
Anymore advice?
When I use idlelogoff 600 logoff, I do not get an interactive desktop (just a blue background and mouse pointer). After the 600 seconds, the session logs out as it should and I get the login screen again. any idea why my desktop is not displaying properly?
Thanks,
Darin
To Jeremy, and DG
How are you calling this application in your script. If you don’t use the ‘start’ command it will cause your batch file to not run properly.
Like this:
start idlelogoff.exe 900 LOGOFF
Is that how you are running it from your script?
Thanks,
Steve
I’ve tried it with and without the “start” command.
Yes that is how I am doing it.
@echo off
cd C:\Program Files\RISALO
start RISALO.exe 10 logoff
I changed it to 10 seconds for testing and it still doesnt work. Without and without the start function the process still starts…But still no logoff. Thanks!
If I run the batch file manually it logs off like it should which is wierd…Both the process that starts at logon and when I run it manually are owned by the currently logged in user.
Jeremy, and DG – What type of logon script is this..group policy..in the users startup folder…netlogon?
That could have an effect…there might be permissions issues involved with forcing the logoff.
Its group policy in the logon script folder..the actual file path is crazy but its in the right place. I do not have it in the netlogon folder.
I’m calling it from a logon script within GP.
For me, the logoff functions properly, but I just don’t get an interactive desktop…just a blue background and mouse pointer.
It works great for me, as long as I’m only using one command (logoff, lock, etc). My batch file looks like this:
start idlelogoff.exe 30 LOCK
start idlelogoff.exe 60 LOGOFF
My pc logs off after 60 seconds, but it doesn’t lock.
Ok Good info from both of you…and thanks for the info Steve.
Is it a User Policy, or a Computer Policy that the script is running under?
Thanks,
Steve
User policy.
Mine is a logon script so its a user policy not a computer policy.
I changed my logon script to look like this and it works now. Obviously I had to move the location of the .exe to the location below too. I think there was some sort of permissions issue with it being under Program Files, I really dont know…Just happy its working! π
cd C:\”Documents and Settings”\”All Users”\RISALO
START RISALO.exe 14400 logoff
I really appreciate all the help too. I cant imagine most people being as dedicated to helping there “customers” especially since this is’nt a paid product. Thank you!
Good info Jeremy, Thanks for telling us what caused the issue for you.
Where are you putting your exe file DG?
Thanks,
Steve
@DG
Have you tried using two seperate batch files? I would make a few copies of the .exe and keep the original. Rename the copies to Autolock & Autologoff then have the two batch files call on their respective applications.
Let us know.