Disabling auto log off in Windows Server

2

I want to run GUI tests on my Windows Server 2012. So first I connect to my server remotely and then disconnect by using tscon: %windir%\System32\tscon.exe RDP-Tcp#NNN /dest:console as described by here: http://support.smartbear.com/viewarticle/72794/

The problem is if I don't do any tests for several minutes (15-30 mins) then it automatically logs off, so if I run my tests after that (which is through Bamboo), they don't run; however if I run them just after running that command above to disconnect then tests run fine. I also noticed that if I just run that command and then connect to the server again it doesn't have login screen; but if I wait for some period and then try to connect again then I get the login screen. I tried these methods before: How do I prevent the Welcome Screen / Lock Screen from appearing after idling in Windows 8?

How can I fix this issue?

Sarp Kaya

Posted 2015-10-08T07:45:30.793

Reputation: 121

Answers

3

It looks like you're after the Session Time Limits Group Policy settings.

You can find them in the Local Group Policy Editor (gpedit.msc) under:

Computer Configuration-Administrative Templates-Windows Components-Remote desktop Services-remote desktop Session host-session time limit.

enter image description here

These policies control the time limits for various Remote Desktop Service sessions.

Michael Frank

Posted 2015-10-08T07:45:30.793

Reputation: 7 412

How should I configure these policies? – Sarp Kaya – 2015-10-08T08:42:25.143

Enable them and set a value in seconds that you want to keep the connection alive for. For example, 24 hours is 86400 seconds. – Michael Frank – 2015-10-08T08:47:16.200

I kept them no limit and it didn't work? – Sarp Kaya – 2015-10-08T11:03:08.630