Giter Site home page Giter Site logo

dsccommunity / xremotedesktopsessionhost Goto Github PK

View Code? Open in Web Editor NEW
35.0 24.0 47.0 433 KB

This module contains DSC resources for the management and configuration of Microsoft Remote Desktop Session Host (RDSH).

License: MIT License

PowerShell 100.00%

xremotedesktopsessionhost's Introduction

xRemoteDesktopSessionHost

This module contains DSC resources for the management and configuration of Microsoft Remote Desktop Session Host (RDSH).

Build Status Azure DevOps coverage (branch) codecov Azure DevOps tests PowerShell Gallery (with prereleases) PowerShell Gallery

Code of Conduct

This project has adopted this Code of Conduct.

Releases

For each merge to the branch master a preview release will be deployed to PowerShell Gallery. Periodically a release version tag will be pushed which will deploy a full release to PowerShell Gallery.

Contributing

Please check out common DSC Community contributing guidelines.

Change log

A full list of changes in each version can be found in the change log.

Documentation

The documentation can be found in the xRemoteDesktopSessionHost Wiki. The DSC resources schema files is used to automatically update the documentation on each PR merge.

Examples

You can review the Examples directory in the xRemoteDesktopSessionHost module for some general use scenarios for all of the resources that are in the module.

The resource examples are also available in the xRemoteDesktopSessionHost Wiki.

Resources

  • xRDSessionDeployment creates and configures a deployment in RDSH.
  • xRDSessionCollection creates an RDSH collection.
  • xRDSessionCollectionConfiguration configures an RDSH collection.
  • xRDRemoteApp publishes applications for your RDSH collection.
  • xRDServer adds RD Server features to your RDSH deployment.
  • xRDGatewayConfiguration creates and configures RD Gateway.
  • xRDLicenseConfiguration creates and configures RD Licensing server.

xRDSessionDeployment

  • SessionHost: Specifies the FQDNs of the servers to host the RD Session Host role service.
  • ConnectionBroker: The FQDN of a server to host the RD Connection Broker role service.
  • WebAccessServer: The FQDNs of the servers to host the RD Web Access role service.

xRDSessionCollection

  • CollectionName: Specifies a name for the session collection (Max length is 256 characters)
  • SessionHost: Specifies one or more RD Session Host servers to include in the session collection.
  • CollectionDescription: A description for the collection.
  • ConnectionBroker: The Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • Force: Indicates that servers may be added to or removed from the collection.

xRDSessionCollectionConfiguration

  • CollectionName: Specifies the name for the session collection. (Max length is 256 characters)
  • ActiveSessionLimitMin: Specifies the maximum time, in minutes, an active session runs. After this period, the RD Session Host server ends the session.
  • AuthenticateUsingNLA: Indicates whether to use Network Level Authentication (NLA). If this value is $True, Remote Desktop uses NLA to authenticate a user before the user sees a logon screen.
  • AutomaticReconnectionEnabled: Indicates whether the Remote Desktop client attempts to reconnect after a connection interruption.
  • BrokenConnectionAction: Specifies an action for an RD Session Host server to take after a connection interruption.
  • ClientDeviceRedirectionOptions: Specifies a type of client device to be redirected to an RD Session Host server in this session collection.
  • ClientPrinterAsDefault: Indicates whether to use the client printer or server printer as the default printer. If this value is $True, use the client printer as default. If this value is $False, use the server as default.
  • ClientPrinterRedirected: Indicates whether to use client printer redirection, which routes print jobs from the Remote Desktop session to a printer attached to the client computer.
  • CollectionDescription: Specifies a description of the session collection.
  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • CustomRdpProperty: Specifies Remote Desktop Protocol (RDP) settings to include in the .rdp files for all Windows Server 2012 RemoteApp programs and remote desktops published in this collection.
  • DisconnectedSessionLimitMin: Specifies a length of time, in minutes. After client disconnection from a session for this period, the RD Session Host ends the session.
  • EncryptionLevel: Specifies the level of data encryption used for a Remote Desktop session.
  • IdleSessionLimitMin: Specifies the length of time, in minutes, to wait before an RD Session Host logs off or disconnects an idle session.
  • MaxRedirectedMonitors: Specifies the maximum number of client monitors that an RD Session Host server can redirect to a remote session. The maximum value for this parameter is 16.
  • RDEasyPrintDriverEnabled: Specifies whether to enable the Remote Desktop Easy Print driver.
  • SecurityLayer: Specifies which security protocol to use.
  • TemporaryFoldersDeletedOnExit: Whether to delete temporary folders from the RD Session Host server for a disconnected session.
  • UserGroup: Specifies a domain group authorized to connect to the RD Session Host servers in a session collection.
  • DiskPath: Specifies the target path to store the User Profile Disks
  • EnableUserProfileDisk: Specifies if this collection uses UserProfileDisks
  • ExcludeFilePath: Specifies a list of strings for files to exclude from the user profile disk
  • ExcludeFolderPath: Specifies a list of strings for folders to exclude from the user profile disk
  • IncludeFilePath: Specifies a list of strings for files to include in the user profile disk
  • IncludeFolderPath: Specifies a list of strings for folders to include in the user profile disk
  • MaxUserProfileDiskSizeGB: Specifies the maximum size in GB for a User Profile Disk

xRDRemoteApp

  • Alias: Specifies an alias for the RemoteApp program.
  • CollectionName: Specifies the name of the personal virtual desktop collection or session collection. The cmdlet publishes the RemoteApp program to this collection. (Max length is 256 characters)
  • Ensure: Specifies if the RemoteApp needs to be Present (default) or Absent.
  • DisplayName: Specifies a name to display to users for the RemoteApp program.
  • FilePath: Specifies a path for the executable file for the application. Note: Do not include any environment variables.
  • FileVirtualPath: Specifies a path for the application executable file. This path resolves to the same location as the value of the FilePath parameter, but it can include environment variables.
  • FolderName: Specifies the name of the folder that the RemoteApp program appears in on the Remote Desktop Web Access (RD Web Access) webpage and in the Start menu for subscribed RemoteApp and Desktop Connections.
  • CommandLineSetting: Specifies whether the RemoteApp program accepts command-line arguments from the client at connection time. Parameters accepts Allow, DoNotAllow or Require as values.
  • RequiredCommandLine: Specifies a string that contains command-line arguments that the client can use at connection time with the RemoteApp program.
  • IconIndex: Specifies the index within the icon file (specified by the IconPath parameter) where the RemoteApp program's icon can be found.
  • IconPath: Specifies the path to a file containing the icon to display for the RemoteApp program identified by the Alias parameter.
  • UserGroups: Specifies a list of domain groups that can view the RemoteApp in RD Web Access, and in RemoteApp and Desktop Connections. To allow all users to see a RemoteApp program, provide a value of Null.
  • ShowInWebAccess: Specifies whether to show the RemoteApp program in the RD Web Access server, and in RemoteApp and Desktop Connections that the user subscribes to.

xRDServer

  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • Server: The FQDN of a server to configure a role on.
  • Role: The name of the Windows RDS feature to add to the server.
  • GatewayExternalFqdn: The external FQDN for the RD Gateway server. Only needed for the RDS-Gateway feature.

xRDGatewayConfiguration

  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • GatewayServer: The server to configure as an RD Gateway.
  • ExternalFqdn: The external FQDN for the RD Gateway server. Only needed for the RDS-Gateway feature.
  • GatewayMode: Set to DoNotUse, Automatic, or Custom
  • LogonMethod: When GatewayMode is custom, sets the logon method for the Gateway.
  • UseCachedCredentials When GatewayMode is custom, configures the use of cached credentials.
  • BypassLocal: When GatewayMode is custom, configues bypassing for local network addresses.

xRDLicenseConfiguration

  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • LicenseServers: An array of servers to use for RD licensing
  • LicenseMode: The RD licensing mode to use. PerUser, PerDevice, or NotConfigured.

xRDCertificateConfiguration

  • Role: Specifies the role that nees to be configured ('RDRedirector', 'RDPublishing', 'RDWebAccess', 'RDGateway').
  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • ImportPath: The certificate that should be used, should point to a PFX file on the filesystem.
  • Credential: The password (if applicable) for the PFX file. The username is ignored.

xRDConnectionBrokerHAMode

  • ConnectionBroker: Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment.
  • DatabaseConnectionString: Specifies the primary connection string to the database.
  • DatabaseSecondaryConnectionString: Specifies the secondary connection string to the database.
  • DatabaseFilePath: Specifies the database file path of SQL Server.
  • ClientAccessName: Specifies the FQDN of client access name.

xremotedesktopsessionhost's People

Contributors

bendunne avatar danielboth avatar dscbot avatar iristyle avatar jeremyciak avatar jimpriestley avatar joeyaiello avatar johlju avatar jpogran avatar karolkaczmarek avatar kennethverbeure avatar kwirkykat avatar ld0614 avatar mgreenegit avatar narrieta avatar nreilingh avatar nyanhp avatar powershellteam avatar robbiddle avatar sam-cogan avatar scottpas avatar travisez13 avatar uw-dc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xremotedesktopsessionhost's Issues

xRDGatewayConfiguration fails with Get-RDDeploymentGatewayConfiguration' is not recognized as the name of a cmdlet, function, script file, or operable

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

Verbose logs showing the problem

Suggested solution to the issue

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

Configuration RDS
{
  param (
    [parameter(Mandatory = $true)]
    [string]$MachineName = 'localhost',
    
    [parameter(Mandatory = $true)]
    [string]$fqdm,

    [parameter(Mandatory = $true)]
    [string]$url,

    [parameter(Mandatory = $true)]
    [string]$thumbPrint
    )

    Import-DscResource -ModuleName xRemoteDesktopSessionHost -ModuleVersion 2.0.0

  
  Node $MachineName
  {

    LocalConfigurationManager
    {
        RebootNodeIfNeeded = $true
        ConfigurationMode = "ApplyOnly"
    }

    #Install the IIS Role
    WindowsFeature SessionHost {
 
      Name   = 'RDS-RD-Server'
      Ensure = 'Present'
    }

    #install web access role
    windowsFeature WebAccess {
        name = 'rds-web-access'
        Ensure = 'present'
    }

    windowsFeature broker {
        name = 'rds-connection-broker'
        ensure = 'present'
    }
    
    windowsFeature gateway {
        name = 'rds-gateway'
        ensure = 'present'
    }
    windowsFeature RDLicensing {
      Name = 'rds-licensing'
      Ensure = 'Present'
    }


    xRDSessionDeployment NewDeployment {
 
      ConnectionBroker = $fqdm
      SessionHost = $fqdm
      WebAccessServer = $fqdm
      DependsOn = '[windowsFeature]WebAccess'
      }
      xRDSessionCollection collection {
       
      CollectionName = 'QuickSessionCollection'
      SessionHost = $fqdm
      ConnectionBroker = $fqdm
      DependsOn = '[xRDSessionDeployment]NewDeployment'
      }
       
      xRDSessionCollectionConfiguration collectionconfig {
       
      CollectionName = 'QuickSessionCollection'
      ConnectionBroker = $fqdm
      AutomaticReconnectionEnabled = $true
      BrokenConnectionAction = 'Disconnect'
      UserGroup = 'Domain Users'
      DependsOn = '[xRDSessionCollection]collection'
      TemporaryFoldersDeletedOnExit = $true
      SecurityLayer = 'Negotiate'
      EncryptionLevel = 'ClientCompatible'
      AuthenticateUsingNLA = $true
      }

      xRDLicenseConfiguration licenseconfig {

        ConnectionBroker = $fqdm
        LicenseServer = $fqdm
        LicenseMode = 'PerUser'
        DependsOn = '[xRDSessionCollectionConfiguration]collectionconfig'
        }

      xRDGatewayConfiguration GatewayConfig {

        DependsOn = '[xRDSessionCollectionConfiguration]collectionconfig','[windowsFeature]gateway'
        ConnectionBroker = $fqdm
        GatewayServer = $fqdm
        GatewayMode = 'Custom'
        LogonMethod = 'Password'
        UseCachedCredentials = $true
        BypassLocal = $false
        ExternalFqdn = $url
      }

      script CustomScript {
        
        DependsOn = '[xRDGatewayConfiguration]GatewayConfig','[WindowsFeature]broker'
        GetScript            =  { return @{result = 'result'} }
        TestScript           = { return $false }
        SetScript            = {
          Import-Module -Name RemoteDesktop -Global
          $roles=@(
          'RDWebAccess'
          'RDPublishing'
          'RDRedirector'
          'RDGateway'
          )
                  
          foreach($role in $roles){
          
            Set-RDCertificate -role $role -Thumbprint $using:thumbPrint  -ConnectionBroker $using:fqdm -force
          }
      }
    }
  } 
}

The operating system the target node is running

Version and build of PowerShell the target node is running

Version of the DSC module that was used

Please define the xRDServer resource

It is in the documentation, and as was suggested in my other thread, this is almost a critical resource for use in Citrix or VMware deployments. Neither of these technologies use the MS RDS collections or configurations.

As part of this resource, an option should be specified to allow RDS connections without NLA authentication.

David F.

xRDLicenseConfiguration: ConnectionBroker required.

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

For my purposes, I need to set a few settings in gpedit.msc Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Licensing:
1.
a) Use the specified Remote Desktop license servers parameter switch to Enabled.
b) License servers to use , set localhostname or its own IP-address.
2.
a) Set the Remote licensing mode parameter switch to Enabled.
b) Specify the licensing mode for the RD Session Host server field set to Per Device.

I planed to use xRDLicenseConfiguration to set these settings but it requires installed RDS-Connection-Broker component and set ConnectionBroker.

But all this result I can get manually only with installed RDS-Licensing, RDS-RD-Server and using gpedit.msc .

Tell me please, how I can get same result using xRDLicenseConfiguration only?

Verbose logs showing the problem

At line:28 char:9
+         xRDLicenseConfiguration SetRDPLicensingSettings
+         ~~~~~~~~~~~~~~~~~~~~~~~
Resource 'xRDLicenseConfiguration' requires that a value of type 'String' be provided for property 'ConnectionBroker'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingValueForMandatoryProperty

Suggested solution to the issue

Make ConnectionBroker as optional parametr.

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

Configuration Basic_settings
{
    Import-DSCResource -ModuleName ComputerManagementDsc #For Powerplan, PagingSettings, SetTimeZone
    Import-DSCResource -ModuleName PSDesiredStateConfiguration
    Import-DSCResource -ModuleName xRemoteDesktopSessionHost #For RDP
    
    Node "localhost"
    {

        $servername = 'testserver'
        $workgroupname = 'company'

        Computer SetNameandWorkgroup
        {
            Name          = $servername
            WorkGroupName = $workgroupname
        }

        #---------------- RDP ------------------
        
        WindowsFeatureSet InstallRDS
        {
            # Install Desktop Licensing and Remote Desktop Session Host from Remote Desktop Services
            Name = @('RDS-Connection-Broker', 'RDS-Licensing', 'RDS-RD-Server')
            Ensure = 'Present'            
        }

        xRDLicenseConfiguration SetRDPLicensingSettings
        {
            #ConnectionBroker = $servername
            LicenseMode = 'PerDevice'
            DependsOn = '[WindowsFeatureSet]InstallRDS'
            LicenseServer = $servername
            PsDscRunAsCredential = $credential
        }
    }
}

$configData = @{
    AllNodes = @(
        @{
            NodeName = '*'
            PSDscAllowPlainTextPassword = $True
            PsDscAllowDomainUser = $true   
        }
        @{
            NodeName = 'localhost'
            PSDscAllowPlainTextPassword = $True
            PsDscAllowDomainUser = $true   
        }
    )
}

Basic_settings -OutputPath "C:\DSC\Configurations" -ConfigurationData $configData

The operating system the target node is running

OsName               : Microsoft Windows Server 2016 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsBuildLabEx    : 14393.1794.amd64fre.rs1_release.171008-1615
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

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

Version of the DSC module that was used

current xRemoteDesktopSessionHost 1.9.0.0

ะธะทะพะฑั€ะฐะถะตะฝะธะต

ะธะทะพะฑั€ะฐะถะตะฝะธะต

xRDCertificateConfiguration:The term ''Get-RDServer'' is not recognized

ISSUE DESCRIPTION
I'm using Ansible to run the xRDCertificateConfiguration resource and only when applying a certificate to the RDWebaccess role I get the following error message.

Failed to invoke DSC Set method: Failed to apply certificate from path ''C:\windows\temp\rds-cert.pfx'' to role ''RDWebAccess'' on connection broker ''hostnamel''. Error: ''The term ''Get-RDServer'' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'''

Suggested solution to the issue

I figured this was an issue due to the box not being ready so I added a delay of 60 seconds and 10 retires and unfortunately the result is the same.

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

  • name: Configure RDS Certificate
    win_dsc:
    Resource_name: xRDCertificateConfiguration
    Role: "{{ item }}"
    ConnectionBroker: "{{ hostname }}.{{ domain }}"
    ImportPath: C:\windows\temp\rds-cert.pfx
    Credential_username: Welcome1!
    Credential_password: Welcome1!
    PsDscRunAsCredential_username: "{{ domain_admin }}"
    PsDscRunAsCredential_password: "{{ domain_admin_password }}"
    with_items:
    • RDRedirector
    • RDPublishing
    • RDWebAccess

###Output of successfully applying a certificate to other roles
TASK [ad_rds : Configure RDS Certificate] ************************************************************************************************************************************************************************************************************************changed: [10.9.10.18] => (item=RDRedirector) => changed=true
ansible_loop_var: item
attempts: 1
item: RDRedirector
module_version: 2.0.0
reboot_required: false
changed: [10.9.10.18] => (item=RDPublishing) => changed=true
ansible_loop_var: item
attempts: 1
item: RDPublishing
module_version: 2.0.0
reboot_required: false

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
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.771
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.771
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

Version 2.0.0

xRDSessionDeploymentCertificateConfiguration: A way to assign certificates

Description

Currently, there isn't a way to apply certificates to each role (RDGateway, RDWebAccess, RDPublishing, RDRedirector). I propose there is a resource created called xRDSessionDeploymentCertificateConfiguration to configure this. The reason I gave it this name is because the certificate assignment in the Server Manager GUI lives in the Deployment Properties.

The Set-RDCertificate CMDLET can be used to set the certificate.

Proposed properties

Properties match closely to the Set-RDCertificate CMDLET:

  • Role
  • CertificatePath
  • Thumbprint
  • Password
  • ConnectionBroker

Special considerations or limitations

support existing certificate for xRDCertificateConfiguration via Thumbprint

It looks like the Set-RDCertificate cmdlet has a -Thumbprint option that lets you use a existing certificate in the localmachine\my environment. However, i don't think this is supported in the DSC version yet.

It would be great if we where able to use this feature. That way we can install the certificate from a kv directly onto our local store in the vm and configure rds with it

xRDSessionDeployment Results in "You cannot call a method on a null-valued expression."

When I try to deploy the xRDSessionDeployment resource on a new Windows Server 2016 machine, I am getting this error message:

"Message": "The PowerShell DSC resource \u0027[xRDSessionDeployment]Deployment\u0027 with SourceInfo \u0027::184::3::xRDSessionDeployment\u0027 threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.",
"Data": { },
"InnerException": {
"ErrorRecord": "You cannot call a method on a null-valued expression.",

In #24 Fix Issue where DSC configuration gets into a reboot loop, line 72

(Get-TargetResource @PSBoundParameters).SessionHost -ieq $SessionHost

was changed to

# We need to perform the following check case insensitive because in some
# cases the SessionHost of Get-TargetResource is uppercase while the
# $sessionHost parameter is lowercase causing a reboot loop to happen.
(Get-TargetResource @PSBoundParameters).SessionHost.ToLower() -ieq $SessionHost.ToLower()

If New-RDSessionDeployment has not yet been run, then (Get-TargetResource @PSBoundParameters).SessionHost is null and calling .ToLower() results in the exception.

On a related note, -ieq is already case-insensitive so is .ToLower() needed here? Unit tests would help verify whether #24 is resolving the issue mentioned in the code comments.

Deployment ends in failure when executing on windows server 2016

my dsc-configuration fails on following error:

RD Connection Broker Configuration Failed on AWINGU-APP-1.ALLIESANDMORRISON.CO.UK With Error: The RD Connection Broker cannot be joined to the RD Management server.

When i go and look at my server it seems like everything was configuration as i wanted it.

I have a production deployment where i have an older version of this module (2014) where i install on
a windows server 2012 and there i do not have this problem.

Any idea why i would have this error? My azure arm deployments cannot continue because this configuration fails

following is my configuration:

configuration CreateAppServer
{
    param
    (
        [Parameter(Mandatory)]
        [String]$DnsServerAddress,
        [Parameter(Mandatory)]
        [String]$MachineName,
        [Parameter(Mandatory)]
        [String]$DomainName,
        [Parameter(Mandatory)]
        [PSCredential]$AdminCreds
    )

    Import-DscResource -ModuleName xComputerManagement, xRemoteDesktopSessionHost
    [PSCredential]$DomainCreds = New-Object System.Management.Automation.PSCredential("${DomainName}\$($AdminCreds.UserName)", $AdminCreds.Password)
    [String]$localhost = [System.Net.Dns]::GetHostByName((hostname)).HostName
    [String]$collectionName = 'firstcollection'
    [String]$collectionDescription = 'My first collection'
    [String]$commandLineParameter = '/v:' + $DnsServerAddress

    Node localhost
    {
        LocalConfigurationManager
        {
            ConfigurationMode = 'ApplyOnly'
            ActionAfterReboot = 'ContinueConfiguration'
            RebootNodeIfNeeded = $true
        }

        WindowsFeature Remote-Desktop-Services
        {
            Ensure = "Present"
            Name = "Remote-Desktop-Services"
            DependsOn = "[xComputer]JoinDomain"
        }

        WindowsFeature RDS-RD-Server
        {
            Ensure = "Present"
            Name = "RDS-RD-Server"
            DependsOn = "[xComputer]JoinDomain"
        }

        WindowsFeature RDS-Connection-Broker
        {
            Ensure = "Present"
            Name = "RDS-Connection-Broker"
            DependsOn = "[xComputer]JoinDomain"
        }

        WindowsFeature RDS-Licensing
        {
            Ensure = "Present"
            Name = "RDS-Licensing"
            DependsOn = "[xComputer]JoinDomain"
        }

        WindowsFeature RDS-Web-Access
        {
            Ensure = "Present"
            Name = "RDS-Web-Access"
            DependsOn = "[xComputer]JoinDomain"
        }

        xRDSessionDeployment Deployment
        {
            SessionHost = $localhost
            ConnectionBroker = $localhost
            WebAccessServer = $localhost
            DependsOn = "[WindowsFeature]Remote-Desktop-Services", "[WindowsFeature]RDS-RD-Server"
        }

        xRDSessionCollection Collection
        {
            CollectionName = $collectionName
            CollectionDescription = $collectionDescription
            SessionHost = $localhost
            ConnectionBroker = $localhost
            DependsOn = "[xRDSessionDeployment]Deployment"
        }

        xRDSessionCollectionConfiguration CollectionConfiguration
        {
            CollectionName = $collectionName
            CollectionDescription = $collectionDescription
            ConnectionBroker = $localhost
            TemporaryFoldersDeletedOnExit = $false
            AuthenticateUsingNLA = $false
            DisconnectedSessionLimitMin = 1
            BrokenConnectionAction = "Disconnect"
            DependsOn = "[xRDSessionCollection]Collection"
        }

        xRDRemoteApp Notepad
        {
            CollectionName = $collectionName
            DisplayName = "Notepad"
            FilePath = "C:\Windows\System32\notepad.exe"
            Alias = "notepad"
            CommandLineSetting = "Allow"
            DependsOn = "[xRDSessionCollection]Collection"
        }

        xRDRemoteApp Mstsc
        {
            CollectionName = $collectionName
            DisplayName = "Remote Desktop Connection"
            FilePath = "C:\Windows\System32\mstsc.exe"
            Alias = "mstsc"
            CommandLineSetting = "Require"
            RequiredCommandLine = $commandLineParameter
            DependsOn = "[xRDSessionCollection]Collection"
        }
    }
}



[xRDSessionCollection] 'fails' when RD configuration settings are applied via GPO

Problem description

I'm resurrecting issue #34 here, with a proposal on how we should work around it in the suggested solution. I'm happy to raise a PR for the change.

I've experienced the same thing creating a new RDSessionCollection where certain group policy settings are applied to the session hosts in the collection.

As it stands, this problem means DSC has to be applied at least twice in order to stand up a working RDS deployment which adds to the delay.

Thanks.

Verbose logs

{"time": "2022-09-06T13:40:47.562+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Start  Resource ]  [[xRDSessionCollection]collection FooBar Collection]  "},
  {"time": "2022-09-06T13:40:47.587+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Start  Test     ]  [[xRDSessionCollection]collection FooBar Collection]  "},
  {"time": "2022-09-06T13:40:48.431+01:00", "type": "verbose", "message": "[RDS-BK1]:                            [[xRDSessionCollection]collection FooBar Collection] Checking for existence of RDSH collection."},
  {"time": "2022-09-06T13:40:48.432+01:00", "type": "verbose", "message": "[RDS-BK1]:                            [[xRDSessionCollection]collection FooBar Collection] Getting information about RDSH collection."},
  {"time": "2022-09-06T13:40:50.326+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ End    Test     ]  [[xRDSessionCollection]collection FooBar Collection]  in 2.7400 seconds."},
  {"time": "2022-09-06T13:40:50.326+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Start  Set      ]  [[xRDSessionCollection]collection FooBar Collection]  "},
  {"time": "2022-09-06T13:40:51.660+01:00", "type": "verbose", "message": "[RDS-BK1]:                            [[xRDSessionCollection]collection FooBar Collection] Creating a new RDSH collection."},
  {"time": "2022-09-06T13:41:03.835+01:00", "type": "error", "message": "The property SecurityLayer is configured by using Group Policy settings. Use the Group Policy Management Console to configure this property."},
  {"time": "2022-09-06T13:41:03.975+01:00", "type": "error", "message": "The property EncryptionLevel is configured by using Group Policy settings. Use the Group Policy Management Console to configure this property."},
  {"time": "2022-09-06T13:44:19.341+01:00", "type": "error", "message": "The property UserAuthenticationRequired is configured by using Group Policy settings. Use the Group Policy Management Console to configure this property."},
  {"time": "2022-09-06T13:44:19.521+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ End    Set      ]  [[xRDSessionCollection]collection FooBar Collection]  in 209.1950 seconds."},
  {"time": "2022-09-06T13:44:19.526+01:00", "type": "error", "message": "The PowerShell DSC resource '[xRDSessionCollection]collection FooBar Collection' with SourceInfo 'D:\\DscService\\Build\\Modules\\tpRDSConfig\\0.1.0.130\\tpRDSConfig.psm1::391::9::xRDSessionCollection' threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details."},

DSC configuration

xRDSessionCollection "collection $($collection.CollectionName)" {
            CollectionName       = $collection.CollectionName
            SessionHost          = $collection.SessionHost[0]
            ConnectionBroker     = $ConnectionBroker
            PsDscRunAsCredential = $RDSDeploymentCredential
            DependsOn            = "[xRDSessionDeployment]RdsDeployment"
        }

Suggested solution

Could we add -ErrorAction SilentlyContinue to the call into New-RDSessionCollection and then afterwards, check for the presence of the new RDSessionCollection and return success or fail based on whether or not it was created?

Operating system the target node is running

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

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.2931
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2931
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

xRemoteDesktopSessionHost version

Name                      Version Path
----                      ------- ----
xRemoteDesktopSessionHost 2.1.0   C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\2.1.0\xRemoteDesktopSessionHost.psd1

xRDSessionCollection and xRDSessionCollectionConfiguration issue

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

I am trying to configure RDS deployment across 3 servers. Everything is working until it comes to xRDSessionCollectionConfiguration. Error I receive is
Failed to lookup RD Session Collection RDS. I think that the problem starts at xRDSSessionCollection. When I run Get-RDSessionCollection I receive this error

PS C:\Windows\system32> Get-RDSessionCollection
New-Object : Exception calling ".ctor" with "1" argument(s): "Invalid parameter "
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop\SessionDesktopCollection.psm1:520 char:14

  • ... $scope = New-Object System.Management.ManagementScope("\" + $Conn ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
    • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

CollectionName Size ResourceType CollectionType CollectionDescription


RDS 0 RemoteApp programs PooledUnmanaged

NOTE: I am not creating Remote App session collection. In powershell it show remote app but in server manager it show Remote Desktop.

Verbose logs showing the problem

PowerShell DSC resource MSFT_xRDSessionCollectionConfiguration failed to execute Set-TargetResource functionality with error message: Failed to lookup RD Session Collection RDS. Error: Exception calling ".ctor" with "1" argument(s): "Invalid parameter "
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : rdcb01

Suggested solution to the issue

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

$data = @{

AllNodes = @(

@{
NodeName = '*'
PSDscAllowPlainTextPassword = $true
PSDscAllowDomainUser = $true

},

@{

NodeName = 'rdcb01'
Role = 'Connection Broker'

},

@{

NodeName = 'rdsh01'
Role = 'Session Host'

},

@{

NodeName = 'rdwa01'
Role = 'Web Access'

}

);

RDSData = @{

ConnectionBroker = 'rdcb01.gs.com'
SessionHost = 'rdsh01.gs.com'
WebAccessServer = 'rdwa01.gs.com'
CollectionName = 'RDS'
AutomaticReconnectionEnabled = $true
DisconnectedSessionLimitMin = 360
IdleSessionLimitMin = 360
BrokenConnectionAction = 'Disconnect'
UserGroup = 'Domain Users'
}

}

Configuration RDS {

param (

[parameter(Mandatory=$true)]
[pscredential]$DomainAdmin

)

#region DSC Resource Modules

Import-DscResource -ModuleName PSDesiredStateConfiguration,
@{ModuleName='xRemoteDesktopSessionHost';ModuleVersion="1.8.0.0"}

#endregion

Node $AllNodes.Where{$_.Role -eq 'Connection Broker'}.NodeName {
$RDData = $data.RDSData

WindowsFeature RDSConnectionBroker {

Name = 'RDS-Connection-Broker'
Ensure = 'Present'
}

WaitForAll SessionHost {

NodeName = 'rdsh01'
ResourceName = '[WindowsFeature]SessionHost'
RetryIntervalSec = 15
RetryCount = 50
DependsOn = '[WindowsFeature]RDSConnectionBroker'
}

WaitForAll WebAccess {

NodeName = 'rdwa01'
ResourceName = '[WindowsFeature]WebAccess'
RetryIntervalSec = 15
RetryCount = 50
DependsOn = '[WaitForAll]SessionHost'
}

xRDSessionDeployment NewDeployment {

ConnectionBroker = $RDData.ConnectionBroker
SessionHost = $RDData.SessionHost
WebAccessServer = $RDData.WebAccessServer
PsDscRunAsCredential = $DomainAdmin
DependsOn = '[WaitForAll]WebAccess'
}

xRDSessionCollection collection {

CollectionName = $RDData.CollectionName
SessionHost = $RDData.SessionHost
ConnectionBroker = $RDData.ConnectionBroker
PsDscRunAsCredential = $DomainAdmin
DependsOn = '[xRDSessionDeployment]NewDeployment'
}

xRDSessionCollectionConfiguration collectionconfig {

CollectionName = $RDData.CollectionName
BrokenConnectionAction = $RDData.BrokenConnectionAction
AutomaticReconnectionEnabled = $RDData.AutomaticReconnectionEnabled
ConnectionBroker = $RDData.ConnectionBroker
IdleSessionLimitMin = $RDData.IdleSessionLimitMin
DisconnectedSessionLimitMin = $RDData.DisconnectedSessionLimitMin
PsDscRunAsCredential = $ADUserCredential
DependsOn = '[xRDSessionCollection]collection'
}

}

Node $AllNodes.Where{$_.Role -eq 'Session Host'}.NodeName {

WindowsFeature SessionHost {

Name = 'RDS-RD-Server'
Ensure = 'Present'
PsDscRunAsCredential = $ADUserCredential
}

}

Node $AllNodes.Where{$_.Role -eq 'Web Access'}.NodeName {

WindowsFeature WebAccess {

Name = 'RDS-Web-Access'
Ensure = 'Present'
PsDscRunAsCredential = $ADUserCredential
}
}
}

RDS -OutputPath 'C:' -ConfigurationData $data -Verbose

The operating system the target node is running

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

OBS!!!! I RECEIVE THE SAME ISSUE EVEN WHEN RUNNING SERVER 2016

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.17763.1

PSEdition Desktop

PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}

BuildVersion 10.0.17763.1

CLRVersion 4.0.30319.42000

WSManStackVersion 3.0

PSRemotingProtocolVersion 2.3

SerializationVersion 1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

1.8.0.0

xRDSessionDeployment: Not checking/limiting on connectionbroker validity

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

Scenario: new deployment

Verbose logs showing the problem

[enhancement]
right now, this Get-TargetResource assumes(?) that it is being targeted by the ConnectionBroker parameter. but does not actually check if provided parameter value and targeted hostname are the same.

Suggested solution to the issue

A simple check in the Get-TargetResource on provided ConnectionBroker value and the targetted hostname.

Creating Session Collection fails when disconnectedSessionLimit is already set with a GPO

The property DisconnectedSessionLimit is configured by using Group Policy settings. Use the Group Policy Management Console to configure this property. The PowerShell DSC resource \u0027[xRDSessionCollection]Collection\u0027 with SourceInfo \u0027C:\Packages\Plugins\Microsoft.Powershell.DSC\2.75.0.0\DSCWork\CreateAppServer.ps1.0\CreateAppServer.ps1::79::9::xRDSessionCollection\u0027 threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details. The SendConfigurationApply function did not succeed. LCM failed to start desired state configuration manually.",

Always fail Test when CollectionName exceed 15 letters

Description

xRDSessionCollectionConfiguration and xRDRemoteApp resources always failed TEST when Collection Name exceeds 15 letters.

Reproduce

Following Configuration will always run SET for xRDSessionCollectionConfiguration and xRDRemoteApp

Configuration InstallRemoteDesktopSessionHost
{
    Import-DscResource -ModuleName PSDesiredStateConfiguration;
    Import-DscResource -ModuleName xRemoteDesktopSessionHost;

    Node "localhost"
    {
        LocalConfigurationManager
        {
            RebootNodeIfNeeded = $true
        }

        WindowsFeature Remote-Desktop-Services
        {
            Ensure = "Present"
            Name = "Remote-Desktop-Services"
        }

        WindowsFeature RDS-RD-Server
        {
            Ensure = "Present"
            Name = "RDS-RD-Server"
        }

        WindowsFeature Desktop-Experience
        {
            Ensure = "Absent"
            Name = "Desktop-Experience"
        }

        WindowsFeature RSAT-RDS-Tools
        {
            Ensure = "Present"
            Name = "RSAT-RDS-Tools"
            IncludeAllSubFeature = $true
        }

        WindowsFeature RDS-Connection-Broker
        {
            Ensure = "Present"
            Name = "RDS-Connection-Broker"
        }

        WindowsFeature RDS-Web-Access
        {
            Ensure = "Present"
            Name = "RDS-Web-Access"
        }

        WindowsFeature RDS-Licensing
        {
            Ensure = "Present"
            Name = "RDS-Licensing"
        }

        WindowsFeature RDS-Gateway
        {
            Ensure = "Present"
            Name = "RDS-Gateway"
        }

        xRDSessionDeployment Deployment
        {
            SessionHost = $Node.FQDN
            ConnectionBroker = $Node.FQDN
            WebAccessServer = $Node.FQDN
            DependsOn = "[WindowsFeature]Remote-Desktop-Services", "[WindowsFeature]RDS-RD-Server"
        }

        xRDSessionCollection Collection
        {
            CollectionName = $Node.CollectionName
            CollectionDescription = $Node.CollectionDescription
            SessionHost = $Node.FQDN
            ConnectionBroker = $Node.FQDN
            DependsOn = "[xRDSessionDeployment]Deployment"
        }

        xRDSessionCollectionConfiguration CollectionConfiguration
        {
            CollectionName = $Node.CollectionName
            CollectionDescription = $Node.CollectionDescription
            ConnectionBroker = $Node.FQDN
            TemporaryFoldersDeletedOnExit = $false
            SecurityLayer = "SSL"
            DependsOn = "[xRDSessionCollection]Collection"
        }

        xRDRemoteApp Calc
        {
            CollectionName = $Node.CollectionName
            DisplayName = "Calculator"
            FilePath = "C:\Windows\System32\calc.exe"
            Alias = "calc"
            DependsOn = "[xRDSessionCollection]Collection"
        }

        xRDRemoteApp Mstsc
        {
            CollectionName = $Node.CollectionName
            DisplayName = "Remote Desktop"
            FilePath = "C:\Windows\System32\mstsc.exe"
            Alias = "mstsc"
            DependsOn = "[xRDSessionCollection]Collection"
        }
    }
}

$data = @{
    AllNodes = @(
        @{
            NodeName = "*"
            FQDN = [System.Net.Dns]::GetHostEntry("localhost").HostName
            CollectionName = "ABCDE FGHIJ KLMNO" #17 letters
            CollectionDescription = "A collection of SAMPLE Servers"
        },
        @{
            NodeName = "localhost"
        }
    )
}

InstallRemoteDesktopSessionHost -ConfigurationData $data
Set-DscLocalConfigurationManager -Path .\InstallRemoteDesktopSessionHost -Force
Start-DscConfiguration -Path .\InstallRemoteDesktopSessionHost -Wait -Force -Verbose

You can avoid this issue with less than 15 character for CollectionName.

Suggestion

Add Length Validation to CollectionName Property would be much appreciated.

Missing modules

We've been working with the xRemoteDesktopSessionHost DSC module that is included with azure-quickstart-templates/rds-deployment/. This module includes several other resources for configuring a RDS environment that are not included in this published version. I assume these were built by the RDS team but it would be nice if they were either combined into this module or a new DSC module created (something like xRemoteDesktopConfiguration) to include the resources that are missing from this module. Those resources are:

xRDGatewayConfiguration
xRDLicenseConfiguration
xRDServer

Let us know if there are any plans to provide/maintain these in the PowerShell Gallery.

Thanks...Greg

xRDRemoteApp: Property [ Verbose ] with value True does not match

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

I am using the XRemoteDesktopSessionHost resource to deploy my Remote Desktop Session Host instance, and everything seems to be working correctly.

However, the xRDRemoteApp resources are running successfully, but then Test-DscConfiguration is showing them as InDesiredState: False due to what looks like an issue with the Verbose property.

Any thoughts?

I can reproduce this on 2 machines now.

Verbose logs showing the problem

Start-DscConfiguration -Wait -Verbose -UseExisting returns

VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Getting published RemoteApp program
Calculator, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Alias ] with value win32calc does
 not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ CollectionName ] with value
Collection 1 does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ DisplayName ] with value
Calculator does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ FilePath ] with value
C:\Windows\system32\win32calc.exe does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Verbose ] with value True does
not match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]Win32Calc]  in 3.7260 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Fetching FTAs and Icon contents from
endpoint: DEV-RDS05.IRMDEV.IRM.COM
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]Win32Calc]  in 10.1170 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Getting published RemoteApp program Internet
Explorer, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Alias ] with value iexplore does
not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ CollectionName ] with value
Collection 1 does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ DisplayName ] with value Internet
Explorer does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ FilePath ] with value C:\Program
Files\Internet Explorer\iexplore.exe does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Verbose ] with value True does not
 match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]iexplore]  in 4.7620 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Fetching FTAs and Icon contents from
endpoint: DEV-RDS05.IRMDEV.IRM.COM
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]iexplore]  in 11.9650 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]iexplore]

Running Start-DscConfiguration -Wait -Verbose -UseExisting a second time returns

VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]:                            [[xRDSessionCollection]RDSessionCollection] Checking for existence of
RDSH collection.
VERBOSE: [DEV-RDS05]:                            [[xRDSessionCollection]RDSessionCollection] Getting information about
RDSH collection.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDSessionCollection]RDSessionCollection]  in 1.5150 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Skip   Set      ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Getting published RemoteApp program
Calculator, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Verbose ] with value True does
not match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]Win32Calc]  in 3.8600 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]Win32Calc]  in 8.2350 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Getting published RemoteApp program Internet
Explorer, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Verbose ] with value True does not
 match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]iexplore]  in 4.2250 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]iexplore]  in 7.0790 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]iexplore]

Suggested solution to the issue

I don't have one at this time.

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

		xRDRemoteApp Win32Calc{
			CollectionName = "Collection 1"
			DisplayName = "Calculator"
			FilePath = "C:\Windows\system32\win32calc.exe"
			Alias = "win32calc"
			DependsOn = "[xRDSessionCollection]RDSessionCollection"
		}		
		xRDRemoteApp iexplore{
			CollectionName = "Collection 1"
			DisplayName = "Internet Explorer"
			FilePath = "C:\Program Files\Internet Explorer\iexplore.exe"
			Alias = "iexplore"
			DependsOn = "[xRDSessionCollection]RDSessionCollection"
		}

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.771
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.771
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

1.9.0.0

xRemoteApp: Ignores the CollectionName set by the user

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.

xRDSessionCollection: Specifying a new SessionHost does nothing

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

Two servers with the xRDSessionCollection resource specified and run on them where everything is the same except for the SessionHost parameter will result in only one of them being in the Session Collection as part of the initial creation. The second Session Host will never get added.

Verbose logs showing the problem

Suggested solution to the issue

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

# insert configuration here

The operating system the target node is running

Version and build of PowerShell the target node is running

Version of the DSC module that was used

xRDSessionDeployment: You cannot call a method on a null-valued expression

System info (W2016 Azure VM)

$psversiontable

Name                           Value
----                           -----
PSVersion                      5.1.14393.2312
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.2312
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


 [environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      14393  0

Issue

When calling the 'xRDSessionDeployment' in a 'clean machine', it fails with:

You cannot call a method on a null-valued expression.
At line:80 char:5
+     (Get-TargetResource @PSBoundParameters).SessionHost.ToLower() -ie ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

(above info is from loading the resource as function and calling them direct)

The whole thing makes perfect sense, when calling the Get-TargetResource you'll get:

PS C:\Users\devadmin> Get-TargetResource -SessionHost "dev-rdg1.develop.local" -ConnectionBroker "dev-rdb1.develop.local" -WebAccessServer "dev-rdg1.develop.local"

Name                           Value                                                                                                                   
----                           -----                                                                                                                   
WebAccessServer                                                                                                                                        
SessionHost                                                                                                                                            
ConnectionBroker                         

...and indeed; you cannot do a .ToLower() on an empty value...

Looking back in the releases; this code changed since v1.5.0.0 and this bug seems to be there since then.....(ouch?!)

Solution (proposal)

I do not expect this to be fixed as this code already changed/improved in dev branch.. So I also checked that code. This too contains a bug:

PS C:\Users\devadmin> Test-TargetResource -SessionHost "dev-rdg1.develop.local" -ConnectionBroker "dev-rdb1.develop.local" -WebAccessServer "dev-rdg1.develop.local"
Get-Service : Cannot find any service with service name 'RDMS'.
At line:26 char:9
+     if((Get-Service -Name RDMS | Select-Object -ExpandProperty Status ...
+         ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (RDMS:String) [Get-Service], ServiceCommandException
    + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand
 
WARNING: Failed to start RDMS service. Error: Cannot find any service with service name 'RDMS'.
False

The easy fix would be:

    # Start service RDMS is needed because otherwise a reboot loop could happen due to
    # the RDMS Service being on Delay-Start by default, and DSC kicks in too quickly after a reboot.
    if((Get-Service -Name RDMS -ErrorAction SilentlyContinue| Select-Object -ExpandProperty Status) -ne 'Running') 
    {
        try
        {
            Start-Service -Name RDMS -ErrorAction Stop
        }
        catch
        {
            Write-Warning "Failed to start RDMS service. Error: $_"
        }
    }

But I am unsure why simpler code of earlier versions has expanded to so elaborate one as above... probably the provide better feedback?

Finally

Kind request; as this resource item is main/core functionality of this DSC module and does not seem to work (you cannot not deploy an RDS environment with v1.5.0.0 or above); please push the next release asap..

xRDServer: Adding RDS-Web-Access role throws exception

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

Using xRDServer ressource to add an RDS-Web-Access server raises exceptions but works anyway.

Verbose logs showing the problem

{
    "Exception":  {
                      "Message":  "The PowerShell DSC resource \u0027[xRDServer]AddWebServer02\u0027 with SourceInfo \u0027::179::9::xRDServer\u0027 threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.",
                      "Data":  {

                               },
                      "InnerException":  {
                                             "SerializedRemoteException":  "System.Management.Automation.CommandNotFoundException: The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\n   at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)\r\n   at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)\r\n   at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)\r\n   at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)\r\n   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)\r\n   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)",
                                             "SerializedRemoteInvocationInfo":  "System.Management.Automation.InvocationInfo",
                                             "ErrorRecord":  "The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.",
                                             "WasThrownFromThrowStatement":  false,
                                             "Message":  "The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.",
                                             "Data":  "System.Collections.ListDictionaryInternal",
                                             "InnerException":  null,
                                             "TargetSite":  null,
                                             "StackTrace":  null,
                                             "HelpLink":  null,
                                             "Source":  null,
                                             "HResult":  -2146233087
                                         },
                      "TargetSite":  null,
                      "StackTrace":  null,
                      "HelpLink":  null,
                      "Source":  null,
                      "HResult":  -2146233079
                  },
    "TargetObject":  null,
    "CategoryInfo":  {
                         "Category":  7,
                         "Activity":  "",
                         "Reason":  "InvalidOperationException",
                         "TargetName":  "",
                         "TargetType":  ""
                     },
    "FullyQualifiedErrorId":  "NonTerminatingErrorFromProvider",
    "ErrorDetails":  null,
    "InvocationInfo":  null,
    "ScriptStackTrace":  null,
    "PipelineIterationInfo":  [

                              ]
}

Suggested solution to the issue

I found a workaround by adding a reboot if Add-RDServer fails. This is not a ideal solution as it could result in an infinite loop, but it does the job for me right now.

 xRDSessionDeployment RDDeployment
{
    ConnectionBroker = $MainConnectionBroker
    WebAccessServer = $WebAccessServer1
    SessionHost = $SessionHost
    PsDscRunAsCredential = $AdminCreds
    DependsOn = "[xDSCDomainjoin]JoinDomain"
}

Script AddWebServer02 {
    GetScript = { @{} } # not used
    SetScript = {
        try {
            Import-Module RemoteDesktop
            Add-RDServer -Server $Using:WebAccessServer2 -Role 'RDS-Web-Access' -ConnectionBroker $Using:ConnectionBroker
        }
        catch {
              # The function throws an exception but still works
        }
    }
    TestScript = {
        Import-Module RemoteDesktop
        $servers = Get-RDServer -Role 'RDS-Web-Access' -ConnectionBroker $Using:MainConnectionBroker -ErrorAction SilentlyContinue
        if ($servers -and $Using:WebAccessServer2 -in $servers.Server) { return $true } else { return $false }
    }
    
    PsDscRunAsCredential = $AdminCreds
    DependsOn = "[xRDSessionDeployment]RDDeployment"
}  

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

xRDSessionDeployment RDDeployment
{
    ConnectionBroker = $MainConnectionBroker
    WebAccessServer = $WebAccessServer1
    SessionHost = $SessionHost
    PsDscRunAsCredential = $AdminCreds
    DependsOn = "[xDSCDomainjoin]JoinDomain"
}


xRDServer AddWebServer02
{
    ConnectionBroker = $MainConnectionBroker
    Role = 'RDS-Web-Access'
    Server = $WebAccessServer2
    PsDscRunAsCredential = $AdminCreds
    DependsOn = "[xRDServer]AddGateway02"
}

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.1852
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1852
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used

2.0.0

xRDSessionCollectionConfiguration does not support setting UserProfileDisk settings

The xRDSessionCollectionConfiguration resource should be able to configure UserProfileDisk related settings which are:

DiskPath
EnableUserProfileDisk
MaxUserProfileDiskSizeGB
IncludeFolderPath
ExcludeFolderPath
IncludeFilePath
ExcludeFilePath

Also, the resource should be able to disable the UserProfileDisk configuration if the configuration specifies so.

UserProfileDisks are a W2016+ feature only and that is probably why this resource does not support them yet. Also, on Set-RDSessionCollectionConfiguration, both enabling and disabling the User Profile Disk configuration are different parameter sets, so just adding these as parameters won't work if we don't fix the resource.

Proposed solution:

  • Add this functionality to xRDSessionCollectionConfiguration
  • Detect on which OS we are running (remove parameters for UserProfileDisk configuration if we are running on 2012)
  • When running on 2016+ test and apply the UserProfileDisk settings

Version tested: 1.5.0.0

xRDSessionCollection: Impossible to add a second Session Collection on Server 2019

Problem description

This relates to issue #91 which wasn't properly resolved by PR #92

In my use case, I am trying create an RDS deployment with two RD Session Collections, uxing `xRDSessionCollection.

The Test-TargetResource function in xRDSessionCollection relies on Get-TargetResource, within the same resource.

Get-TargetResource has been amended so that it filters the RD Session Collections on CollectionName matching the desired $CollectionName if there is more than one RD Session Collection returned from Get-RDSessionCollection, which had it's filtering removed (bug) when it was migrated from using WMI to CIM for Windows Server 2019.

I'm not sure why the change to xRDSessionCollection was implemented in this way, with a qualification around the filtering.

In the logs attached, there is no existing RD Session Collection called Test Collection, but because Test-TargetResource returns true, Set-TargetResource is never run.

Verbose logs

{"time": "2022-09-06T15:59:38.575+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Start  Resource ]  [[xRDSessionCollection]collection Test Collection]  "},
  {"time": "2022-09-06T15:59:38.591+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Start  Test     ]  [[xRDSessionCollection]collection Test Collection]  "},
  {"time": "2022-09-06T15:59:39.763+01:00", "type": "verbose", "message": "[RDS-BK1]:                            [[xRDSessionCollection]collection Test Collection] Checking for existence of RDSH collection."},
  {"time": "2022-09-06T15:59:39.778+01:00", "type": "verbose", "message": "[RDS-BK1]:                            [[xRDSessionCollection]collection Test Collection] Getting information about RDSH collection."},
  {"time": "2022-09-06T15:59:40.528+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ End    Test     ]  [[xRDSessionCollection]collection Test Collection]  in 1.9380 seconds."},
  {"time": "2022-09-06T15:59:40.528+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ Skip   Set      ]  [[xRDSessionCollection]collection Test Collection]  "},
  {"time": "2022-09-06T15:59:40.528+01:00", "type": "verbose", "message": "[RDS-BK1]: LCM:  [ End    Resource ]  [[xRDSessionCollection]collection Test Collection]  "},

DSC configuration

@{
                        CollectionName                 = 'Main Collection'
                        SessionHost                    = @('rdsh0.somedomain.sometld,rdsh1.somedomain.sometld')
                    }
                    @{
                        CollectionName                 = 'Test Collection'
                        SessionHost                    = @('rdsh2.somedomain.sometld')
                    }

~~~

    foreach ($collection in $Collections) {
        xRDSessionCollection "collection $($collection.CollectionName)" {
            CollectionName       = $collection.CollectionName
            SessionHost          = $collection.SessionHost[0]
            ConnectionBroker     = $ConnectionBroker
            PsDscRunAsCredential = $RDSDeploymentCredential
            DependsOn            = "[xRDSessionDeployment]RdsDeployment"
        }
    }

Suggested solution

Re-implment as:

$Collection = Get-RDSessionCollection `
    -CollectionName $CollectionName `
    -ConnectionBroker $ConnectionBroker `
    -ErrorAction SilentlyContinue | `
        Where-Object  CollectionName -eq $CollectionName

or

    $params = @{
        CollectionName   = $CollectionName
        ConnectionBroker = $ConnectionBroker
        ErrorAction      = 'SilentlyContinue'
    }

    $Collection = Get-RDSessionCollection @params  | `
        Where-Object  CollectionName -eq $CollectionName

... depending on preferred layout/coding standards

Operating system the target node is running

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

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.2931
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2931
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

xRemoteDesktopSessionHost version

Name                      Version Path
----                      ------- ----
xRemoteDesktopSessionHost 2.1.0   C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\2.1.0\xRemoteDesktopSessionHost.psd1

Add NewConnectionAllowed in xRDSSessionCollection

Is there any interest, for you, that when we add a sessionhost to a collection, we can tell if the openings of sessions on this server are authorized or not?

Parameter is NewConnectionAllowed

During my deployments by hand, I often block connections to check that everything is working well on the server before opening them.
I also sometimes block connections when I am notified of a problem on a server in order to be able to diagnose
On the other hand in automatic I wonder if there is really an interest
What do you think?

When applying xRDSessionCollection to an RDS Host which is not also a Connection Broker the following error is being thrown

When applying xRDSessionCollection to an RDS Host which is not also a Connection Broker the following error is being thrown:

A parameter cannot be found that matches parameter name 'CollectionDescription'. + CategoryInfo : InvalidArgument: (:) [], CimException + FullyQualifiedErrorId : NamedParameterNotFound,Add-RDSessionHost + PSComputerName : localhost
Fixed in pull this pull request: #25

MSFT_xRDSessionCollection: Collection related DSC fails when multiple collections are present

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

xRDSessionCollection DSC fails on Windows Server 2019 if multiple RD Session Collections are present

Verbose logs showing the problem

[[xRDSessionCollection]Collection] Getting information about RDSH
collection.
Cannot process argument transformation on parameter 'CollectionName'. Cannot convert value to type System.String.
+ CategoryInfo : InvalidData: (:) [], CimException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-RDSessionHost
+ PSComputerName : localhost
Cannot index into a null array.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NullArray
+ PSComputerName : localhost
Cannot index into a null array.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NullArray
+ PSComputerName : localhost

Suggested solution to the issue

Issue is caused by malfunctioning Get-RDSessionCollection cmdlet in Windows Server 2019.
Microsoft will need to address the underlying issue.
I'll be submitting a Pull Request with a workaround for the MSFT_xRDSessionCollection DSC Resource.

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

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

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

Version of the DSC module that was used

XRDServer: Unable to set two roles

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

Unable to build MOF to set the RDS-Licensing Role and RDS-Gateway role on the same server,

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

    XRDServer LicenseServer
    {
        ConnectionBroker = $localhost
        Server = $localhost
        Role = 'RDS-Licensing'
    }
   
    XRDServer GatewayServer
    {
        ConnectionBroker = $localhost
        Server = $localhost
        Role = 'RDS-Gateway'
        GatewayExternalFqdn = $GatewayExternalFqdn
    }

Verbose logs showing the problem

PS C:\WINDOWS\system32> \tsc-dev-dc2\Desktop\ben.dunne\Desktop\RDSCONFIG-BUILDFILE.ps1
Test-ConflictingResources : A conflict was detected between resources '[xRDServer]LicenseServer
(\tsc-dev-dc2\Desktop\ben.dunne\Desktop\RDSCONFIG-BUILDFILE.ps1::86::9::XRDServer)' and '[xRDServer]GatewayServer
(\tsc-dev-dc2\Desktop\ben.dunne\Desktop\RDSCONFIG-BUILDFILE.ps1::93::9::XRDServer)' in node 'localhost'. Resources have identical key properties but there are
differences in the following non-key properties: 'Role;GatewayExternalFqdn'. Values 'RDS-Licensing;NULL' don't match values
'RDS-Gateway;TSC-DEV-TS11-rdg.securevirtual.com'. Please update these property values so that they are identical in both cases.
At line:289 char:9

  •     Test-ConflictingResources $keywordName $canonicalizedValue $k ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Write-Error], InvalidOperationException
    • FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
      Compilation errors occurred while processing configuration 'RDSConfig'. Please review the errors reported in error stream and modify your configuration code
      appropriately.
      At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5
  • throw $ErrorRecord
    
  • ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (RDSConfig:String) [], InvalidOperationException
    • FullyQualifiedErrorId : FailToProcessConfiguration

Suggested solution to the issue

I suggest that these two configurations shouldn't be conflicting.

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.3085.amd64fre.rs1_release.190703-1816
OsLanguage : en-GB
OsMuiLanguages : {en-GB, en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

Current

xRDServer: CimClass for does not appear to load in the DSC Namespace

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

Working to map the DSC Resources in this module for Puppetization requires being able to load the cim class for each resource and introspect on its properties - this is the most accurate way to programmatically map a DSC Resource, including fully mapping nested CIM instances.

The way we do this is first, make a dummy call to Invoke-DscResource to ensure the CIM class we want to introspect is loaded, like so:

$InvokeParams = @{
  Name       = 'xRDServer'
  Method     = 'Get'
  Property   = @{foo = 1}
  ModuleName = @{
    # Path to the module on disk
    ModuleName    = 'C:\dsc\...\xRemoteDesktopSessionHost\xRemoteDesktopSessionHost.psd1'
    ModuleVersion = '2.0.0'
  }
  ErrorAction = 'Stop'
}
Try {
  Invoke-DscResource @InvokeParams
} Catch {
  # We only care if the resource can't be found, not if it fails while executing
  if ($_.Exception.Message -match '(Resource \w+ was not found|The PowerShell DSC resource .+ does not exist at the PowerShell module path nor is it registered as a WMI DSC resource)') {
    $PSCmdlet.ThrowTerminatingError($_)
  }
}
# Then we can check the DSC namespace for the expected class:
Get-CimClass -ClassName 'MSFT_xRDServer' -Namespace 'root\Microsoft\Windows\DesiredStateConfiguration' 

The final line above errors like so:

writeErrorStream      : True
PSMessageDetails      :
OriginInfo            :
Exception             : Microsoft.Management.Infrastructure.CimException: Not found
                           at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext
                        callbackProcessingContext, T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)
TargetObject          : root\Microsoft\Windows\DesiredStateConfiguration:MSFT_xRDServer
CategoryInfo          : ObjectNotFound: (root\Microsoft\...:MSFT_xRDServer:String) [Get-CimClass], CimException
FullyQualifiedErrorId : HRESULT 0x80041002,Microsoft.Management.Infrastructure.CimCmdlets.GetCimClassCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}

And we can see if we filter the DSC namespace for classnames matching xrd that it is indeed not loaded:

Get-CimClass -Namespace 'root\Microsoft\Windows\DesiredStateConfiguration' | ? {$_.cimclassname -match 'xrd'}


   NameSpace: ROOT/Microsoft/Windows/DesiredStateConfiguration

CimClassName                        CimClassMethods      CimClassProperties
------------                        ---------------      ------------------
MSFT_xRDGatewayConfiguration        {}                   {ConfigurationName, DependsOn, ModuleName, ModuleVersion...}
MSFT_xRDLicenseConfiguration        {}                   {ConfigurationName, DependsOn, ModuleName, ModuleVersion...}
MSFT_xRDRemoteApp                   {}                   {ConfigurationName, DependsOn, ModuleName, ModuleVersion...}
MSFT_xRDCertificateConfiguration    {}                   {ConfigurationName, DependsOn, ModuleName, ModuleVersion...}

Notably, this worked fine for xRDCertificateConfiguration, xRDGatewayConfiguration, xRDRemoteApp, and xRDLicenseConfiguration before failing to load the CIM class for xRDServer. I reworked the catch/throw block to write the error anyway and in all cases the error message was the same - could not find RemoteDesktop module - but the other CIM classes still loaded into memory.

Not sure offhand how to hunt this one down but I wanted to at least raise it - of more than 50 modules so far converted, this is the only module we've encountered this problem with.

The operating system the target node is running

OsName: Microsoft Windows 10 Pro
OsOperatingSystemSKU: 48
OsArchitecture: 64-bit
WindowsVersion: 1909
WindowsBuildLabEx: 18362.1.amd64fre.19h1_release.190318-1202
OsLanguage: en-US
OsMuiLanguages: {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.18362.1171
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.1171
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used

2.0.0

xRDRemoteApp: Allow for an array of values for the UserGroups parameter

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

The UserGroups parameter only accepts a single string, when it should support supplying an array of values.

Verbose logs showing the problem

Suggested solution to the issue

Allow for supplying an array of values to the UserGroups parameter.

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

# insert configuration here

The operating system the target node is running

Version and build of PowerShell the target node is running

Version of the DSC module that was used

Missing xRDServer resource?

Is this resource actually missing from the module? It is in the readme, but when I check it is not there?

PS C:\> Get-DscResource -Module xremotedesktopsessionhost

ImplementedAs   Name                      ModuleName                     Version    Properties
-------------   ----                      ----------                     -------    ----------
PowerShell      xRDRemoteApp              xRemoteDesktopSessionHost      1.6.0.0    {Alias, CollectionName, DisplayN...
PowerShell      xRDSessionCollection      xRemoteDesktopSessionHost      1.6.0.0    {CollectionName, SessionHost, Co...
PowerShell      xRDSessionCollectionCo... xRemoteDesktopSessionHost      1.6.0.0    {CollectionName, ActiveSessionLi...
PowerShell      xRDSessionDeployment      xRemoteDesktopSessionHost      1.6.0.0    {ConnectionBroker, SessionHost, ...

I'm looking to use this to configure my hosts that won't be part of an RDS Deployment..

Thanks,

David F.

xRDLicenseConfiguration: No way to licence RDS

Description

This DSC resource doesn't contain a method to license RDS, which is a key bit missing from this collection of DSC resources as well as the Certificate assignment mentioned in #63.

Looking into a method to do this for my own environment in PowerShell, I used a mixture for the RDS:LicenseServer location and using the WMI/CIM class Win32_TSLicenseKeyPack to apply the license and activate.

Here is an example of activating using the method InstallAgreementLicenseKeyPack for this particular type of license.

Set-Location RDS:LicenseServer -ErrorAction Stop

Set-Item .\Configuration\FirstName -Value "Test" -ErrorAction Stop
Set-Item .\Configuration\LastName -Value "Test" -ErrorAction Stop
Set-Item .\Configuration\Company -Value "Test" -ErrorAction Stop
Set-Item .\Configuration\CountryRegion -Value "Test" -ErrorAction Stop
Set-Item .\ActivationStatus -Value 1 -ConnectionMethod AUTO -Reason 5 -ErrorAction Stop

Applies License

$Argumentlist =@(
4, # AgreementType
9999, # LicenseCount
1, # ProductType
5, # ProductVersion
$agreementnumber # AgreementNumber
)

$InstallLicenseKey = Invoke-WmiMethod -Namespace "root/cimv2" -Class Win32_TSLicenseKeyPack -Name InstallAgreementLicenseKeyPack -ArgumentList $Argumentlist

Adds the license server to the Terminal Server License Servers group on the domain controller (Run as Enterprise Admin)

Set-Item -Path RDS:\LicenseServer\LSinTSLSGroup -Value 1 -ErrorAction Stop

Proposed properties

I'm not really sure this can vary wildly depending on the type of License you trying to apply.

Special considerations or limitations

xRDSessionCollectionConfiguration: Various Parameters are not properly compared

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

Supplying values for certain parameters either does not function as intended, or sometimes even throws errors. Parameters impacted:

  • CustomRdpProperty
  • ExcludeFilePath
  • ExcludeFolderPath
  • IncludeFilePath
  • IncludeFolderPath

Verbose logs showing the problem

Suggested solution to the issue

Perform some normalization against the provided parameters and current values to do a proper comparison

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

xRDSessionCollectionConfiguration 'TestSessionCollection'
{
    CollectionName        = 'TestSessionCollection'
    EnableUserProfileDisk = $true
    DiskPath              = 'C:\temp'
    ExcludeFilePath       = @()
    ExcludeFolderPath     = @('C:\temp\foo', 'C:\temp\bar')
    IncludeFilePath       = @()
    IncludeFolderPath     = @()
}

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

2.0.0-preview0003

Is xRDLicenseConfiguration Available in Any Releases?

I'm not sure if I am asking this question correctly, but I hope someone will understand.

If I run this command to install version 1.6.0.0 of xRemoteDesktopSessionHost

install-module -name xRemoteDesktopSessionHost

I am able to add these resources in my configuration file:

  • xRDRemoteApp
  • xRDSessionCollection
  • xRDSessionCollectionConfiguration
  • xRDSessionDeployment

But xRDLicenseConfiguration is missing. How can I access xRDLicenseConfiguration?

IdleSessionLimitMin can only be set by GPO

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

ConnectionBroker fails when specifying another server to be Connection Broker

Checked every statement in the response, and every single point is OK.

VERBOSE: [2016Server02]: [[xRDSessionDeployment]Deployment] Verify the validation failures before adding RD Connection Broker server to the deployment.
A valid fully qualified domain name (FQDN) for the server was not specified.
Unable to connect to the server by using Windows PowerShell remoting. Verify that you can connect to the server.
The server is not joined to a domain.
The currently logged on user is not a member of the local Administrators group on the server.
The server must be running at least Windows Server 2016.
The server has reboots pending and needs to be restarted.
Remote Desktop Services connections are denied by Group Policy.

Keeps rebooting in a loop

Hi when using this for RDS deployment on windows 2016 it enters an state of a reboot loop after i states "The deployment was successful" in an "xRDSessionDeployment". Then i hangs in that state, and never continues to the Collection or CollectionConfiguration???

Any ideas?

VERBOSE: Performing the operation "Start-DscConfiguration: SendMetaConfigurationApply" on target "MSFT_DSCLocalConfigurationManager".
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendMetaConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer 2016DSC02 with user sid S-1-5-21-662093251-837600086-2983080374-500.
VERBOSE: [2016DSC02]: LCM: [ Start Set ]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [MSFT_DSCMetaConfiguration]
VERBOSE: [2016DSC02]: LCM: [ Start Set ] [MSFT_DSCMetaConfiguration]
VERBOSE: [2016DSC02]: LCM: [ End Set ] [MSFT_DSCMetaConfiguration] in 0.0140 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [MSFT_DSCMetaConfiguration]
VERBOSE: [2016DSC02]: LCM: [ End Set ]
VERBOSE: [2016DSC02]: LCM: [ End Set ] in 0.0420 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Set-DscLocalConfigurationManager finished in 0.274 seconds.
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = TestConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer 2016DSC02 with user sid S-1-5-21-662093251-837600086-2983080374-500.
VERBOSE: [2016DSC02]: LCM: [ Start Compare ]
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DscResources\MSFT_RoleResource\MSFT_RoleResource.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionDeployment\MSFT_xRDSessionDeployment.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionCollection\MSFT_xRDSessionCollection.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionCollectionConfiguration\MSFT_xRDSessionCollectionConfiguration.psm1 in force mode.
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] The operation 'Get-WindowsFeature' started: Remote-Desktop-Services
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] The operation 'Get-WindowsFeature' succeeded: Remote-Desktop-Services
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]Remote-Desktop-Services] True in 0.2600 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] The operation 'Get-WindowsFeature' started: RDS-RD-Server
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] The operation 'Get-WindowsFeature' succeeded: RDS-RD-Server
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-RD-Server] True in 0.2030 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Tools
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Tools
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Gateway
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Gateway
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Licensing-Diagnosis-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Licensing-Diagnosis-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RDS-Licensing-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RDS-Licensing-UI
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RSAT-RDS-Tools] True in 0.6660 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] The operation 'Get-WindowsFeature' started: RDS-Connection-Broker
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] The operation 'Get-WindowsFeature' succeeded: RDS-Connection-Broker
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Connection-Broker] True in 0.2040 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] The operation 'Get-WindowsFeature' started: RDS-Web-Access
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] The operation 'Get-WindowsFeature' succeeded: RDS-Web-Access
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Web-Access] True in 0.2020 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] The operation 'Get-WindowsFeature' started: RDS-Licensing
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] The operation 'Get-WindowsFeature' succeeded: RDS-Licensing
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Licensing] True in 0.2060 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Checking RDSH role is deployed on this node.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Getting list of RD Server roles.
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[xRDSessionDeployment]Deployment] False in 1.2290 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[xRDSessionCollection]Collection]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[xRDSessionCollection]Collection]
VERBOSE: [2016DSC02]: [[xRDSessionCollection]Collection] Importing the module MSFT_xRDSessionCollection in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionCollection]Collection] Importing the module MSFT_xRDSessionCollection in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionCollection]Collection] Checking for existance of RDSH collection.
VERBOSE: [2016DSC02]: [[xRDSessionCollection]Collection] Getting information about RDSH collection.
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[xRDSessionCollection]Collection] False in 0.7110 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[xRDSessionCollection]Collection]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[xRDSessionCollectionConfiguration]CollectionConfiguration]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[xRDSessionCollectionConfiguration]CollectionConfiguration]
VERBOSE: [2016DSC02]: [[xRDSessionCollectionConfiguration]CollectionConfiguration] Importing the module MSFT_xRDSessionCollectionConfiguration in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionCollectionConfiguration]CollectionConfiguration] Importing the module MSFT_xRDSessionCollectionConfiguration in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionCollectionConfiguration]CollectionConfiguration] Testing DSC collection properties
VERBOSE: [2016DSC02]: [[xRDSessionCollectionConfiguration]CollectionConfiguration] Getting currently configured RDSH Collection properties
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[xRDSessionCollectionConfiguration]CollectionConfiguration] False in 2.9200 seconds.
VERBOSE: [2016DSC02]: LCM: [ FAILEDCompare ] Completed processing compare operation. The operation returned False.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 7.443 seconds
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DESKTOP-DOOA2AM with user sid S-1-5-21-662093251-837600086-2983080374-500.
VERBOSE: [2016DSC02]: LCM: [ Start Set ]
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DscResources\MSFT_RoleResource\MSFT_RoleResource.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionDeployment\MSFT_xRDSessionDeployment.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionCollection\MSFT_xRDSessionCollection.psm1 in force mode.
VERBOSE: [2016DSC02]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopSessionHost\1.4.0.0\DscResources\MSFT_xRDSessionCollectionConfiguration\MSFT_xRDSessionCollectionConfiguration.psm1 in force mode.
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] The operation 'Get-WindowsFeature' started: Remote-Desktop-Services
VERBOSE: [2016DSC02]: [[WindowsFeature]Remote-Desktop-Services] The operation 'Get-WindowsFeature' succeeded: Remote-Desktop-Services
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]Remote-Desktop-Services] in 0.2080 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]Remote-Desktop-Services]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] The operation 'Get-WindowsFeature' started: RDS-RD-Server
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-RD-Server] The operation 'Get-WindowsFeature' succeeded: RDS-RD-Server
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-RD-Server] in 0.2100 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-RD-Server]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Tools
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Tools
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Gateway
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Gateway
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RSAT-RDS-Licensing-Diagnosis-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RSAT-RDS-Licensing-Diagnosis-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' started: RDS-Licensing-UI
VERBOSE: [2016DSC02]: [[WindowsFeature]RSAT-RDS-Tools] The operation 'Get-WindowsFeature' succeeded: RDS-Licensing-UI
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RSAT-RDS-Tools] in 0.6780 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RSAT-RDS-Tools]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] The operation 'Get-WindowsFeature' started: RDS-Connection-Broker
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Connection-Broker] The operation 'Get-WindowsFeature' succeeded: RDS-Connection-Broker
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Connection-Broker] in 0.2030 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Connection-Broker]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] The operation 'Get-WindowsFeature' started: RDS-Web-Access
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Web-Access] The operation 'Get-WindowsFeature' succeeded: RDS-Web-Access
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Web-Access] in 0.2060 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Web-Access]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] The operation 'Get-WindowsFeature' started: RDS-Licensing
VERBOSE: [2016DSC02]: [[WindowsFeature]RDS-Licensing] The operation 'Get-WindowsFeature' succeeded: RDS-Licensing
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[WindowsFeature]RDS-Licensing] in 0.2060 seconds.
VERBOSE: [2016DSC02]: LCM: [ Skip Set ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[WindowsFeature]RDS-Licensing]
VERBOSE: [2016DSC02]: LCM: [ Start Resource ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: LCM: [ Start Test ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Checking RDSH role is deployed on this node.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Getting list of RD Server roles.
VERBOSE: [2016DSC02]: LCM: [ End Test ] [[xRDSessionDeployment]Deployment] in 1.1990 seconds.
VERBOSE: [2016DSC02]: LCM: [ Start Set ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Importing the module MSFT_xRDSessionDeployment in force mode.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] Initiating new RDSH deployment.
VERBOSE: [2016DSC02]: [[xRDSessionDeployment]Deployment] The deployment was successful.
VERBOSE: [2016DSC02]: LCM: [ End Set ] [[xRDSessionDeployment]Deployment] in 44.9160 seconds.
VERBOSE: [2016DSC02]: LCM: [ End Resource ] [[xRDSessionDeployment]Deployment]
VERBOSE: [2016DSC02]: [] A reboot is scheduled to progress further. Configuration will be continued after the reboot.
WARNING: [2016DSC02]: [] A reboot is scheduled to progress further. Configuration will be continued after the reboot.
VERBOSE: [2016DSC02]: LCM: [ End Set ]
VERBOSE: [2016DSC02]: LCM: [ End Set ] in 48.4900 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 48.816 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.