Question
-
CreatorTopic
-
December 6, 2007 at 1:40 pm #2222623
force logoff after hours expire
Lockedby wancona · about 16 years, 4 months ago
I’ve been trying to force users to logoff after their logon hours have expired through Group Policy. I have a SBS 2003 server and all workstations are running XP Pro. For some reason it is not working.
Topic is locked -
CreatorTopic
All Answers
-
AuthorReplies
-
-
December 6, 2007 at 1:40 pm #2545763
Clarifications
by wancona · about 16 years, 4 months ago
In reply to force logoff after hours expire
Clarifications
-
December 6, 2007 at 3:04 pm #2545727
A link for you!
by scott_heath · about 16 years, 4 months ago
In reply to force logoff after hours expire
-
December 7, 2007 at 8:49 am #2473260
Test without lost
by wancona · about 16 years, 4 months ago
In reply to A link for you!
How do you test the group policy without interfering with productivity
-
December 7, 2007 at 9:16 am #2473233
What exactly does this do
by wancona · about 16 years, 4 months ago
In reply to A link for you!
Does this just force them to work offline. I am looking for something that will shut every application down and log the individual out of the computer. I am having problems with people not remembering to log out at night, and certain scheduled task can not run because they are still logged in. Also, I can’t keep going around to every computer at night to make sure the individual is logged out before I go home. So I need to insure that everyone is logged off before a particular time.
-
December 7, 2007 at 9:47 am #2473216
Oooops
by scott_heath · about 16 years, 4 months ago
In reply to What exactly does this do
I reread it and it only logs them off the server, not the local workstation. Should everyone be gone at a specific time? If so, write a script that kicks off from the server at a specific time and sends all stations a pop up message that they will be logged off in 5 minutes. Then 5 minutes later run a script that will log them off their PC or restart the PC.
-
December 7, 2007 at 10:39 am #2473189
-
December 7, 2007 at 2:09 pm #2631546
Yep
by scott_heath · about 16 years, 4 months ago
In reply to So did I.
The suggestions by Paul and CG IT should do. I was hoping to find a way you could do it without scheduling a script, but oh well.
I would try to build in some logic that verifies the user has actually been logged off. Try it a few times and see how it goes. If you don’t need 100% compliance every single night the shutdown command should work fine.
If you need 100% compliance let me know. Maybe we can work up a vbscript that uses WMI to check for logged on users and then only executes if they are logged on, checks to make sure it logged the user off, then takes more drastic measures if it isn’t working.
-
-
-
December 7, 2007 at 10:42 am #2473187
Any help?
by wancona · about 16 years, 4 months ago
In reply to force logoff after hours expire
After doing research I’ve found that you pretty much have to run a batch file to actually force the user off the workstation. But I’m actually still in school, and I’m not too sure how to script a batch file. Is there anyone who can offer help?
-
December 7, 2007 at 12:10 pm #2473157
use the XP shutdown command
by paul.cook · about 16 years, 4 months ago
In reply to Any help?
set a scheduled task on the workstations to run “shutdown -l -f -t 30” at a specific time
You can use the AT command to set scheduled tasks on remote computers.Or create a batch file on the server and run it at 5:30pm or whenever:
shutdown -l -f -t 30 -m \\computer1
shutdown -l -f -t 30 -m \\computer2
….
or even better use the For command in a batch file to run another batch file on a text file list of computers.
complist.txt:
comp1
comp2.domain.comlogoffcomp.cmd:
shutdown -l -f -t 30 -m \\%1logoffallcomps.cmd (this file is one line)
For /f %%a In (complist.txt) Do Call logoffcomp.cmd %%a-
December 7, 2007 at 1:02 pm #2473131
Pauls got it
by cg it · about 16 years, 4 months ago
In reply to use the XP shutdown command
that will close all applications, then shutdown the workstations.
there is also a command for providing a net message to users about a forced shutdown.
-
December 7, 2007 at 1:27 pm #2473119
Okay, but what about…
by wancona · about 16 years, 4 months ago
In reply to use the XP shutdown command
Okay, if that is to shutdown the computers, is there a way to restart instead of shutdown. Because I really only need them to log off of the workstation so that Scheduled tasks can run in the middle of the night. If it shuts down, then it would defeat the purpose of the log off, and I would still have to go around and turn them back on by hand.
Don’t want to seem unappreciative, That is very helpful information, but can it be tweaked to restart instead of shutdown, or just straight logg off?
-
December 7, 2007 at 1:31 pm #2473118
sure….
by cg it · about 16 years, 4 months ago
In reply to Okay, but what about…
magic packet… or solar winds makes a whole suite of tools which shuts down and then restarts.
there’s many tools on the web…
might ask another question on what are the best freeware or low cost tools for remote/force shutdown and restart.
-
December 7, 2007 at 1:36 pm #2473115
You are very helpful
by wancona · about 16 years, 4 months ago
In reply to sure….
As I stated before, I am still a student, I was just fortunate enough to land a position in my field very early. I am very good at troubleshooting and pinpointing problems. But exactly how do you create a batch file, and should I execute it via Group Policy or go to each workstation and program it.
-
December 7, 2007 at 1:56 pm #2473110
scripting is your friend.
by cg it · about 16 years, 4 months ago
In reply to You are very helpful
Windows Scripting web site.
here’s a link:
http://www.microsoft.com/technet/scriptcenter/default.mspx
note: I use the term scripting which to me is the same as making batch files. They are all excutable files.
here’s a web site on how to use Windows Batch files [scripts]
-
December 24, 2007 at 7:49 am #2652029
-r = reboot
by churdoo · about 16 years, 3 months ago
In reply to Okay, but what about…
Use the -r switch in Paul’s shutdown command above, means REBOOT instead of shutdown.
-
December 24, 2007 at 8:00 am #2652027
Problem solved
by wancona · about 16 years, 3 months ago
In reply to -r = reboot
I was able to create this script which will log off the computer workstation. I tired to post it before for others to use after tweaking it a little bit. But every time I tried, after I submitted it. It said thread unavailable, (on TechRepublics part). So I’ll try again.
And thank you for the help.
strComputer = “.”Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
Set colItems = objWMIService. _
ExecNotificationQuery(“Select * From __InstanceDeletionEvent ” _
& “Within 1 Where TargetInstance ISA ‘Win32_Process'”)Set objWMIService = GetObject(“winmgmts:{(Shutdown)}\\” & _
strComputer & “\root\cimv2”)Set colItems = objWMIService.ExecQuery _
(“Select * from Win32_OperatingSystem”)For Each objItem in colItems
objItem.Win32Shutdown(0)
Next -
February 13, 2009 at 10:00 am #2765686
Are you sure?
by cmarcus · about 15 years, 2 months ago
In reply to use the XP shutdown command
I thought that you couldn’t use the -m switch with the -l switch?
-
-
-
December 7, 2007 at 12:47 pm #2473142
Screensaver
by rahouseholder · about 16 years, 4 months ago
In reply to force logoff after hours expire
You can do this with the screensaver. You will have to enforce the screensaver through the policy.
Take a look here…
http://support.microsoft.com/kb/314999-
December 7, 2007 at 1:33 pm #2473117
I’ve considered that, but…
by wancona · about 16 years, 4 months ago
In reply to Screensaver
I’ve considered that. But the problem arises with the screen saver. If I set it too far off, it will not lock the computer during the working hours when they walk away from their systems. Because we deal with patient information, it has to lock during the day when they are idle, so as not to allow someone to walk up to the workstation and obtain patient information. Yet, if i set the screen saver, it will log them off throughout the day, and they could lose unsaved patient information.
Is there a way to schedule the screensavers to switch to different screensavers at different times? Similar to the way you can program cell phones to be set on a particular ringing theme at certain hours of the day.
-
-
-
AuthorReplies