dsccommunity / xRemoteDesktopSessionHost

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

IdleSessionLimitMin can only be set by GPO #78

Closed pokepoke81 closed 4 years ago

pokepoke81 commented 4 years ago
ISSUE DESCRIPTION:

In xRDSessionCollectionConfiguration, the parameter for IdleSessionLimitMin fails

Details of the scenario you tried and the problem that is occurring

Sending config to collection fails

Verbose logs showing the problem

Failed to invoke DSC Set method: The property IdleSessionLimit is configured by using Group Policy settings. Use the Group Policy Management Console to configure this property.

Suggested solution to the issue

Remove option from config and documentation

The DSC configuration that is used to reproduce the issue (as detailed as possible)

(I'm using Ansible's win_dsc resource, so it's in that format)

resource_name: xRDSessionCollectionConfiguration
        CollectionName: 'RDS-Cluster'
        ActiveSessionLimitMin: '720'
        AuthenticateUsingNLA: True
        AutomaticReconnectionEnabled: True
        BrokenConnectionAction: 'Disconnect'
        ClientDeviceRedirectionOptions: 'None'
        ClientPrinterAsDefault: False
        ClientPrinterRedirected: False
        CollectionDescription: "Collection of Session Hosts for RDS Cluster"
        ConnectionBroker: 'rds-cb01.domain.fqdn'
        DisconnectedSessionLimitMin: '180'
        EncryptionLevel: '1'
        IdleSessionLimitMin: '120'
        MaxRedirectedMonitors: '3'
        RDEasyPrintDriverEnabled: False
        SecurityLayer: '2'
        TemporaryFoldersDeletedOnExit: True
        UserGroup: 'RDS Users'
        DiskPath: '\\rds-upd01.domain.fqdn\UserProfileDisks'
        EnableUserProfileDisk: True
        MaxUserProfileDiskSizeGB: '10'

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Datacenter OsOperatingSystemSKU : DatacenterServerEdition OsArchitecture : 64-bit WindowsVersion : 1809 WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434 OsLanguage : en-US OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.17763.1007 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17763.1007 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Version of the DSC module that was used

I don't see versions

danielboth commented 4 years ago

Hi @pokepoke81, I think the problem here is that it is already set by group policy in your environment and that's what the error warns about. So if you would remove the group policy it would actually be able to apply the setting. Can you test that?

pokepoke81 commented 4 years ago

I am able to run the Powershell command Set-RDSessionCollectionConfiguration manually with all of the settings (including IdleSessionLimitMin) without getting an error. The error comes when trying from DSC (through ansible). I just tried re-running the DSC after manually applying the settings and I get a different error: "Failed to invoke DSC Set method: Unable to configure the RD Session Host server WC-RDS-SH03.wcdom.loc. Invalid parameter " that I'll have to look into why that's occuring.

pokepoke81 commented 4 years ago

It looks like I had another setting misconfigured and instead of complaining about that, it gave me this erroneous error about IdleSessionLimitMin. I was using the numbers for EncryptionLevel instead of the string. This documentation was confusing: https://docs.microsoft.com/en-us/powershell/module/remotedesktop/set-rdsessioncollectionconfiguration?view=win10-ps