Windows Server 2012 R2 prevent automatic logoff due to inactivity

I have a stand alone windows 2012 server R2 that i log on to locally. it is not part of a domain and it is the standard install configuration with no policies enacted. The server logs off the desktop and locks it with a password. How can i prevent this?


In brief

  1. Unlock/turn on console log display off timeout feature in Power Option

  2. Set timeout to 0 to turn it off.

Detail Steps

Unlocked the missing Power Settings feature in Server 2012.

  1. Open the following registry key - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7

  2. Set the following value - Attributes => 2

  3. Now open Control Panel>Power Options>Change Plan Settings>Change Advanced Power Settings
    a. The new Display section Console lock display off timeout is now available.
    b. Configure your “Plugged in” value accordingly (0 to disable)

Done.

p.s.

You may want to download my export .reg file and run it on your machine as a shortcut for step 1 & 2 above i.e. enabling console log display off timeout.

enter image description here


The server is not logging off your session, it is simply locking the screen. You can change this behavior in Power Options in control panel. It's under Display.


I know this is an old question, but this information might be useful to others:

If you are running in a domain environment, create this setting accordingly in a GPO, otherwise configure the local GPO (gpedit.msc):

Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Interactive logon: Machine inactivity limit

If you wann prevent lockout set it to zero, keep in mind the security impact this change can have dependent on your environment.


Expanding Cowboy's answer.

List the power schemes, this will report a list of schems with GUIDs and names.

powercfg /L

The GUIDs have aliases

powercfg -aliases

Common aliases are

SCHEME_MAX = Power saver (Max power saving)
SCHEME_BALANCED = Balanced (Typical)
SCHEME_MIN = High performance (Min power saving)

Then disable for all standard power schemes, for AC and DC.

powercfg /setacvalueindex SCHEME_MIN SUB_NONE CONSOLELOCK 000
powercfg /setdcvalueindex SCHEME_MIN SUB_NONE CONSOLELOCK 000
powercfg /setacvalueindex SCHEME_MAX SUB_NONE CONSOLELOCK 000
powercfg /setdcvalueindex SCHEME_MAX SUB_NONE CONSOLELOCK 000
powercfg /setacvalueindex SCHEME_BALANCED SUB_NONE CONSOLELOCK 000
powercfg /setdcvalueindex SCHEME_BALANCED SUB_NONE CONSOLELOCK 000

I'm running server 2012 R2 Std and the option is there. Just change it in the group policy and set it to 0 as Matze describes above. I just set up 3 2012 servers today and this is how I do it every time. Force a policy update or wait it out. Sometimes I have to log off and back on before it picks up the policy change. To force the policy update run gpupdate /force from an admin prompt.