Forum Discussion
Roger Critz
May 30, 2019Copper Contributor
Configuring Session Settings - How To?
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 ...
SimBur2365
May 06, 2022Brass Contributor
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
http://www.howdoiuseacomputer.com
[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
http://www.howdoiuseacomputer.com