Solved

Force windows logoff after certain amount of LOGON time

Posted on 2004-09-18
7
461 Views
Last Modified: 2013-12-04
I know there are many ways to force user logoff based on idle timeouts, but I need to be able to force a locally logged in user to logoff after say a 2 hour period.  That is to say that the user cannot be logged in for more than 2 hours whether they are doing stuff or not.  
Any help would be much appreciated.
Thanks,
Nate
0
Comment
Question by:nateb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:Quetzal
ID: 12092349
Use the winexit.scr screen save available in Windows NT, 2000, 2003 resource kits.  It does just what you want.

http://www.win2000mag.com/Articles/Index.cfm?ArticleID=4541
0
 

Author Comment

by:nateb
ID: 12115038
actually, maybe i didn't state the question as clear as i could have.  I know about winexit, and other similar programs.  But what I need to be able to do is force logoff based on actual logon time, not on idle time. so, after the user has been logged in for 2 hours, they are automatically logged off.  WHETHER or not they are idle.  i have thought about using onlogon events in the task scheduler and calling an external script to handle this, but there has to be a better way than reinventing the wheel, plus i'm not quite sure how I would terminate the script at user logoff time.....
thanks,
Nate
0
 
LVL 11

Assisted Solution

by:Quetzal
Quetzal earned 75 total points
ID: 12158981
Ur on the right track.  Use PsShutdown (http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml) to schedule the shutdown in the user logon script.  You'll need to calc the shutdown time based on logon time.

Shutdown.exe is available in XP and the NT/2K resource kits, but it lets users abort the shutdown.
0
 
LVL 12

Accepted Solution

by:
alandc earned 175 total points
ID: 12231331
You can do it but I'm not sure how helpful it will be --

Get PSSHUTDOWN.EXE from SYS Internals:
http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml
and install PSSHUTDOWN somewhere in your PATH

Add this line to your logon batch to run shutdown in 7200 seconds (2 hours) with
PSSHUTDOWN -r -t 7200

Of course anyone could just cancel it by running
PSSHUTDOWN -a

And meanwhile the window would be displayed saying
"The system is shutting down ..."

Here is a more complicated plan:
Get CHOICE.EXE from the NT Resource Kit:
http://www.ss64.com/nt/choice.html

Get PSSHUTDOWN.EXE from SYS Internals:
http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml

create the following batch file and name it WAIT.BAT:
@CHOICE /T:N,%1% > NUL

Create the following batch file and call it SHUT2H.BAT:
CALL WAIT 7200
PSSHUTDOWN -r

Place all the above somewhere in your PATH (such as C:\WINNT)
Then call SHUT2H.BAT as the last command in your logon script

Of course the user could just cancel it by hitting Ctrl-BREAK in the script window.

It is possible but it isn't secure.

You could also use FireDaemon
http://www.firedaemon.com/
to cause it to run as a service and that might help with your security needs.

t
0
 

Author Comment

by:nateb
ID: 14029033
I appreciate the input on this issue, but I wasn't able to implement as secure and reliable of a solution as I was hoping for.  I ended up getting sidetracked on other projects and still have not gotten back to this issue, but since the question is will be closed shortly, I wanted to go ahead and apply the points before that was done.  Hopefully I will be able to get back to this project sometime in the near future.
Thank you both for your suggestions.

Nate
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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