Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Limiting session times

  • Filter
  • Time
  • Show
Clear All
new posts

  • Limiting session times

    I would like to limit a group of users so that they are logged out after being logged in for 10 minutes, I would also like to restrict these users to 2 hours a week. I would also like to prevent user logging in at the same time on multiple computers.

    I have a network with 2 DCs (1 with win2k sp4 and 1 with win2003). The clients use winxp (there are other clients on the network running other versions but the users who i wish to resticte cannot use these computer).

    How would I go about achieving this?

    Thank You

  • #2
    Re: Limiting session times

    Dear bens,

    The answer to your first question is Google: limitlogin

    or you can go here.

    I'm pretty sure that you can log user off after they log on for 10 mins. It can be done by log on script with count down timer and actions . Please allow me couple of days, I'll crank my brain and work on a script that's suitable for you.

    In the mean time, if you need additional information, please let me know, I'll try my best.

    Hope this helps,



    • #3
      Re: Limiting session times

      Thank you for your help, I will look into these ideas.

      Do you have any suggestions for implementing a weekly limit of 2 hours?



      • #4
        Re: Limiting session times

        Dear Ben,

        I got the solution for one of your questions and post it right away. Thanks to my friend John from Germany. He didn't mind writing the script for me during his vacation time. I copied and pasted it here. Please review the script and change it to suit your need. I am also consulting him on the time quota for user. And I think this task is more complicated a bit. It needs to be able to use a database to keep track on the time amount....I will let you know how it works out.


        PS. I have tested it by myself. It worked perfectly. And everything in the script is on a single line. Enjoy
        ' ************************************************** *********************
        ' *
        ' * LogoffIn30 - Logs off the current user in 30 minutes
        ' * John Holliday - 12/29/2005 - 1.0
        ' * ChangeAuthorName - DateOfChange - IteratedVersionNumber
        ' *
        ' ************************************************** *********************
        Option Explicit

        Public gobjWshShell

        Sub ScriptInit()
        Set gobjWshShell = CreateObject("WScript.Shell")
        End Sub

        Function Sleep(lintNumOfSeconds, lblnUseMilliseconds)
        ' Put False as the second argument to use standard seconds.
        ' Put True to use milliseconds.
        If lblnUseMilliseconds = False Then
        lintNumOfSeconds = lintNumOfSeconds * 1000
        End If
        WScript.Sleep lintNumOfSeconds
        End Function

        Sub ShutDown(lintShutdownType)
        Dim strComputer
        Dim OpSys
        Dim OpSysSet
        strComputer = "."
        If lintShutDownType = "" then
        lintShutDownType = 4
        End If
        Set OpSysSet = GetObject("winmgmts:{(Debug,Shutdown)}//" & strComputer & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
        For Each OpSys in OpSysSet
        ' The numbers in the Decimal column are for the lintShutDownType variable.
        ' Action Decimal Binary
        ' Logoff 0 0000
        ' Reboot 2 0010
        ' Force Logoff 4 0100
        ' Force Reboot 6 0110
        ' Powerdown 8 1000
        ' Force Powerdown 12 1100
        End Sub

        Sub RunFor30()
        On Error Resume Next
        Dim lblnIsDone
        Dim lintNumMinutes
        lintNumMinutes = 0
        lblnIsDone = False
        Sleep 60, False
        lintNumMinutes = lintNumMinutes + 1
        Select Case lintNumMinutes
        Case 25
        gobjWshShell.Popup "Warning!" & vbCrLf & vbCrLf & "This workstaion will be logged off in 5 minutes!" & vbCrLf & "Please save your data and close any open applications." & vbCrLf & "This box will close in 15 seconds.", 15, "Logoff Warning", vbExclamation + vbOKOnly + vbSystemModal
        Case 30
        lblnIsDone = True
        ShutDown 4
        Case Else
        ' Do nothing
        End Select
        Loop Until lblnIsDone = True
        End Sub

        ' Processing starts here


        ' ***************