Wednesday, April 6, 2016

Fixing a Corrupt Session Collection

The Problem

Occasionally you may run into an issue where you cannot perform certain actions within RDS. For example, attempting to add a new Session Host to a collection will fail with an error stating that the properties could not be distributed to all session hosts. I've also witnessed this error when attempting to modify the settings of a Session Collection, in which case an error message is received stating the following -“Could not set the appropriate properties on the servers. Ensure that all servers are available on the network, and the properties are not managed by Group Policy.”

Error message when attempting to modify a Session Collection

This occurs when a Session Collection becomes corrupted for some reason. If you find yourself in this situation, you can use some pseudo-hidden PowerShell commands to find and fix the corrupt Session Collection.

The Fix

In order to resolve this issue, you'll need to run some PowerShell commands from the active Connection Broker in order to determine which of your Session Collections has become corrupt. Once remoted to the Connection Broker, open a PowerShell prompt and run the following command:

Import-Module C:\Windows\System32\ServerManagerInternal\RDManagement

Next, type the following command to list out all Session Collections:

Get-RDSHPool -Alias *

Running the Get-RDSHPool cmdlet

This cmdlet will list out each Session Collection, including some of the properties of the collections. You'll notice from the screenshot above, that one or more collections will cause an error and no information will be returned. This is one of the corrupt Session Collections. Compare the list of collections that were returned, and using process of elimination, determine which collections are corrupt.

Once you have determined the corrupt collection(s), you can resolve the corruption by modifying any of the properties of the collection. Simply open the RDS console via Server Manager, and modify the properties of the collection - I always found it easiest to quickly add a user to the User Groups tab, save the settings, and then remove the user and save once again.

Running the Get-RDSHPool cmdlet again should return no errors at this point.

Found the issue. There was a GP enabled under "Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services" that was overwriting the settings. Disabling the GP fixed the issue.

This is right. Somehow the Local Group Policy on my two 2012R2 RDS Servers were changed and they had enabled two settings under: computer configuration->Administrative Templates->Windows Components->Remote Desktop Services->Remote Desktop Session Host->Session Time Limits. After using gpedit.msc on each server I set them back to NOT CONFIGURED the problem was gone.

Ran into this as well and it turns out that one of the 6 terminal servers in our collection had local group policy set similar to what the others have reported. Removed them and let the Server Manager Wizard handle everything and it is working now. Server 2106 here.