dsccommunity / xRemoteDesktopSessionHost

This module contains DSC resources for the management and configuration of Microsoft Remote Desktop Session Host (RDSH).
MIT License
36 stars 47 forks source link

xRemoteApp: Ignores the CollectionName set by the user #41

Closed danielboth closed 6 years ago

danielboth commented 6 years ago

In xRemoteApp the following code is used to get the CollectionName of the current server:

https://github.com/PowerShell/xRemoteDesktopSessionHost/blob/5ef201da13d4b89ee33e6f89984721835dfdd5b9/DSCResources/MSFT_xRDRemoteApp/MSFT_xRDRemoteApp.psm1#L98

This setup assumes that the configuration is applied to the ConnectionBroker and that the CollectionBroker is a sessionhost in the targetted collection. This assumption is only valid when the deployment consists of only one node, but it's not valid when multiple nodes are used with multiple collections.

Proposed fix: Change the behaviour of xRemoteApp to test if the targetted CollectionName exists, if it does leave it untouched. If it does not exist, throw an error explaining that the RemoteApp cannot be added to a collection that does not exist.

johlju commented 6 years ago

So there should be a new resource (if there are none yet) that adds one or more collections, so this resource can be used without needing to manually create a collection?

Labeling this as an enhancement.

danielboth commented 6 years ago

Hi @Johlu, there is already a resource that allows to create new collections (xRDSessionCollection) so that part is covered. The problem here is that the CollectionName given by the user was overwritten by the resource taking the collection that existed on the ConnectionBroker. That caused the deployments to target the wrong collection.

I've created PR #42 to resolve this and to change the behavior to just throw an error if the collection does not exist yet.