Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Force windows logoff after certain amount of LOGON time

Posted on 2004-09-18
7
Medium Priority
?
473 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 150 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 350 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

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

Question has a verified solution.

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

In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

604 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