?
Solved

Looking for "after idle for x minutes, logoff" solution

Posted on 2009-02-13
8
Medium Priority
?
625 Views
Last Modified: 2012-05-06
Experts!

I need to review the possibilities of scripting a solution to log off a user after "X" idle time.  I've researched some possibilities, however I haven't come up with anything yet.

From the sounds of it, WMI does not have a method to check the idle time on a windows session.

One of the things I was thinking about trying is to read the position of the mouse and storing the position in a variable.  If the position is the same, then the computer is idle; however, the only way I can think of to check the mouse position is to set an app as focus and check the mouse positioning there.

Does anyone have any possible solutions for this?  I'd prefer to stick to scripting methods and stay away from third party software, but any suggestions are welcome.
0
Comment
Question by:piattnd
  • 4
  • 2
  • 2
8 Comments
 
LVL 58

Expert Comment

by:tigermatt
ID: 23635630

I'd use the WinExit screensaver which you can find information on at http://windowsxp.mvps.org/winexit.htm.

Assuming we're talking about an Active Directory network, once the screensaver tool is installed on each computer on your network, you'd be able to force all PCs to use it through Group Policy - so users cannot change the setting.

-Matt
0
 
LVL 12

Author Comment

by:piattnd
ID: 23635705
I saw this in another post, but there are a few other items we have to try and close "properly" to prevent any issues, which is why I'm hoping for a scriptable solution, so I can close any programs needed or send any commands to the machine before logging the user off.  I've kept this one in mind thouhg.

Anything else?
0
 
LVL 58

Accepted Solution

by:
tigermatt earned 1000 total points
ID: 23635782

Could you use a Scheduled Task which runs a script? There is the option in the Advanced Settings of the schedule on a Scheduled Task to have it run only when the computer is idle for a set period of time. You could easily create a task which runs on idle for X minutes, with the task launching your script to close down the appropriate applications and then log the user off.

The command for logging a user off (in a Windows Shell) would be shutdown.exe -l - and you'd obviously do this last, after you'd run commands to shut other programs.

A less desirable approach - but one that will definitely work.

-Matt
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Author Comment

by:piattnd
ID: 23636081
Hmm, I'll have to give that one a shot,  but as you said, not exactly desireable.  I'll check out that possibility as well.
0
 
LVL 1

Expert Comment

by:WeirdoBc
ID: 23636485
If you want to run a script to close all application safely, the best way to know when the workstation is idle for X minutes, is still to make you script as a screensaver.
0
 
LVL 1

Assisted Solution

by:WeirdoBc
WeirdoBc earned 1000 total points
ID: 23638084
If you can't make a screensaver that do the job, you can also set a defined screensaver (like logon.scr) and look when it's running using vbs :

http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug05/hey0810.mspx

when's it's running, it's time to start your script.
0
 
LVL 12

Author Comment

by:piattnd
ID: 23638622
That's a good thought too.  I'll take a look at both of these items on Monday.
0
 
LVL 12

Author Closing Comment

by:piattnd
ID: 31546708
Thank you both for your help.  This project has slipped to the back burner for now, but I'm closing this question.  Thanks for the answers!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question