Solved

Force windows logoff after certain amount of LOGON time

Posted on 2004-09-18
7
449 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
  • 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advantages and dis-advantages of UAC 27 96
Windows 10 4 59
GPO not applying to designated group-- Server 2012R2 2 64
Securing a laptop that travels frequently 21 88
As I write this article, I am finishing cleanup from the Qakbot virus variant found in the wild on April 18, 2011.  It was a messy beast that had varying levels of infection, speculated as being dependent on how long it resided on the infected syste…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

810 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