Create time based acount lockout GPO.

Discussion in 'Windows Server' started by Rab, May 24, 2014.

  1. Rab

    Rab MDL Member

    May 18, 2009
    127
    12
    10
    I need a way to schedule two accounts to be locked every Sunday at 4 pm.
    Using Google to find a solution hasn’t really helped at all. Numerous different ways of disabling accounts if wrong password is applied x times is all good, but not really what I'm looking for.

    This is for my home network. A server 2008R2 domain network for the family to do backups, updates and keep the children from the darker places on the internet.

    Since my kids is autistic and "fun seekers" it's hard to get them to do anything not fun without hours of arguing. I have disabled their computer accounts until homework, tidying their rooms etc. been done once a week. This have worked quite well as long as I have actually remembered to disable their accounts in time. Hence the need to automate the process.

    What I need help with in short is a script or GPO or other means to schedule the disabling of their accounts at the same time every Sunday afternoon regardless if they are logged on or not at the time. If they are logged on they get kicked from the computer without any possibility to stop the kicking process. A warning a few minutes in advance to save what they might be working on is good, but other than that. BOOM their out!


    It might sound harsh, but since it’s the same to the both of them they accept it and do their chores and catch up on the homework without too much complaining. When done and inspected they get their accounts back.
     
  2. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,457
    980
    60
    Should just create a batch file that runs in the background on start up on either their machines or the server- that disables their accounts at 4PM on Sunday.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Rab

    Rab MDL Member

    May 18, 2009
    127
    12
    10
    Thats exactly what I need. Problem is, I don't know how to build one.

    /Rab
     
  4. wantafanta

    wantafanta MDL Novice

    Jul 23, 2010
    9
    2
    0
    #4 wantafanta, Jun 7, 2014
    Last edited by a moderator: Apr 20, 2017
    h**p://technet.microsoft.com/en-gb/library/cc753390.aspx#BKMK_cmd

    Code:
    dsmod user USERNAME -disabled YES
    Open notepad, copy the above, change as necessary, save file as disableaccount.cmd, then open Task Scheduler (on the Server), create a new task that runs this file. Job done...