Question

  • Creator
    Topic
  • #2222623

    force logoff after hours expire

    Locked

    by wancona ·

    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.

All Answers

  • Author
    Replies
    • #2545763

      Clarifications

      by wancona ·

      In reply to force logoff after hours expire

      Clarifications

    • #2545727
      • #2473260

        Test without lost

        by wancona ·

        In reply to A link for you!

        How do you test the group policy without interfering with productivity

      • #2473233

        What exactly does this do

        by wancona ·

        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.

        • #2473216

          Oooops

          by scott_heath ·

          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.

        • #2473189

          So did I.

          by wancona ·

          In reply to Oooops

          I read the link you gave me, and I realized too that it didn’t logoff the computer, just disconnected the user from the network resources. It is a deceiving title “Fore logoff when hours expire”

        • #2631546

          Yep

          by scott_heath ·

          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.

    • #2473187

      Any help?

      by wancona ·

      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?

      • #2473157

        use the XP shutdown command

        by paul.cook ·

        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.com

        logoffcomp.cmd:
        shutdown -l -f -t 30 -m \\%1

        logoffallcomps.cmd (this file is one line)
        For /f %%a In (complist.txt) Do Call logoffcomp.cmd %%a

        • #2473131

          Pauls got it

          by cg it ·

          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.

        • #2473119

          Okay, but what about…

          by wancona ·

          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?

        • #2473118

          sure….

          by cg it ·

          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.

        • #2473115

          You are very helpful

          by wancona ·

          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.

        • #2473110

          scripting is your friend.

          by cg it ·

          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]

          http://www.iopus.com/guides/batch.htm

        • #2652029

          -r = reboot

          by churdoo ·

          In reply to Okay, but what about…

          Use the -r switch in Paul’s shutdown command above, means REBOOT instead of shutdown.

        • #2652027

          Problem solved

          by wancona ·

          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

        • #2765686

          Are you sure?

          by cmarcus ·

          In reply to use the XP shutdown command

          I thought that you couldn’t use the -m switch with the -l switch?

    • #2473142

      Screensaver

      by rahouseholder ·

      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

      • #2473117

        I’ve considered that, but…

        by wancona ·

        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.

Viewing 3 reply threads