Computer Lockout (Windows)

Locks workstation after 15 minutes idle


The procedure will run some powershell commands to edit registry Key to create some Local Group/Security Policies to enable the computer to lock after 15 minutes.
This procedure is only compatible with Windows 7 and 10 endpoints.
To edit the idle time before the computer goes to sleep, you need to edit the "900" values lines 2 and 5.
The changes will only take effect after the endpoint is restarted. The restart is not part of the procedure in order to schedule it at the most convenient time.

  • Name: Douglas Sanchez
  • Company: Kaseya
  • Website: http://www.kaseya.com
  • Contact Developer
  • Summary
  • Computer Lockout (Windows)
  • Version:
  • Released on April 19th, 2017
  • Reviews
    Gravatar for Andrew Christopherson
    by Andrew Christopherson on August 14th, 2018

    This really helps out with some basic security. It's a great procedure if you have people who forget to lock their computers when they leave. Also, if you have a question about how to remove it from a workstation, check the discussion because the creator explained it there.

    Gravatar for David Osborne
    David Osborne almost 2 years ago

    I tried this on two machine, while it does lock the machines it does not prompt for password, can this be updated? or can i do something in the script to adjust this?

    Gravatar for Andrew Christopherson
    Andrew Christopherson about 1 year ago

    Does this procedure only run once or is it a permanent change? if it's a permanent change, how can I stop it?

    Gravatar for Douglas Sanchez
    Douglas Sanchez about 1 year ago

    @Andrew, The changes are permanent as they are getting applied via registry changes. 

    To stop it I suggest deleting the keys that get created: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\InactivityTimeoutSecs and/or HKCU:\Control Panel\Desktop\ScreenSaveActive, HKCU:\Control Panel\Desktop\ScreenSaverIsSecure, HKCU:\Control Panel\Desktop\ScreenSaveTimeOut, HKCU:\Control Panel\Desktop\SCRNSAVE.EXE

    Gravatar for Andrew Christopherson
    Andrew Christopherson about 1 year ago

    @Douglas, your suggestion seems to be working. Thanks for the quick response and the helpful procedure, I appreciate it.

    Gravatar for Leandro
    Leandro 12 months ago

    Does this work on windows 10?

    Gravatar for Andrew Christopherson
    Andrew Christopherson 12 months ago

    @Leandro, Yeah it does. I'm using it on Windows 10 and Windows 7 right now.

    Gravatar for Leandro
    Leandro 12 months ago

    Awesome. I just needed to restart the machine lol. Thanks! 

    Gravatar for Efraim Wolpin
    Efraim Wolpin 3 days ago


    i set this on a machine for a value of 300 (5 Min) but after a minute it locked. why is this happening?

    Gravatar for Douglas Sanchez
    Douglas Sanchez 3 days ago

    There might be a GPO or some other settings overriding the config.