Configuring Session Settings - How To?

Copper Contributor

In RDS you have the ability to use the gui to be able to set the features like End a disconnected session, Active session limit and Idle session limit. Can this still be accomplished with GPO's? Are there powershell cmdlets to set and/or display the current state?

5 Replies
Hi Roger, you can use existing policies to control the things mentioned. End a disconnected session after specific timeout, Active session limit and Idle session limit are all supported. Create them on the same place where you used to create GPO's for your Windows Server operating systems.

This is an older discussion but still comes up when performing a search on this topic. I had to comment because this type of response drives me crazy. If you are the Microsoft rep answering this question, why can't you fully answer the question. Just by saying you mange this with Group Policy is super lame. In the future could you actually point to the exact policy locations so we don't have to go and Sherlock your answer.

 

Thanks 

@Azure_Trebek There are thousands of policies and many are alike with small nuances and sometimes OS version specific. It's impossible to give a precise answer based on the limited information in posts like this. I'd recommend using this https://gpsearch.azurewebsites.net/ and you'll find the GPO needed within seconds. 

Nice site but cant see any App Locker GPO settings here?
Hi, I kind of agree with @Azure_Trebek - part of the question was "Are there powershell cmdlets to set and/or display the current state?" which noone answered but I assume you found elsewhere by now. So for others - yes! there are of course, seeing as most GPO settings are adding or modifying a registry entry. And in fact, setting the 'common' registry keys as part of a session host deployment makes sense, rather than waiting for a policy to apply. Here are the settings I use:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"KeepAliveEnable"=dword:00000001
"KeepAliveInterval"=dword:00000001
"RemoteAppLogoffTimeLimit"=dword:000dbba0
"MaxDisconnectionTime"=dword:00a4cb80
"MaxConnectionTime"=dword:0f731400
"MaxIdleTime"=dword:00a4cb80

The values above are what I generally use and work great:
RemoteAppLogoffTimeLimit 15 minutes How long after a RemoteApp is closed is the session ended?
MaxDisconnectionTime 3 hours How long after a session is disconnected is the session ended?
MaxConnectionTime 3 days Maximum time a session can run for.
MaxIdleTime 3 hours How long can an active session be idle for before it is disconnected.

You can get a spreadsheet of GPO settings by Googling "group policy settings reference", which also has the reg key in it.

To add or modify a reg key and value using PowerShell:
New-Item 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Force
New-ItemProperty -path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -name 'KeepAliveEnable' -value '1' -PropertyType 'DWord' -Force

Cheers,
Simon
www.howdoiuseacomputer.com