none
Server 2016 and New-RDSessionDeployment via Remote Powershell RRS feed

  • Question

  • Hi

    Got an issue with the New-RDSessionDeployment cmdlet when running it via an PSSession, the cmdlet is executed but returns an error. FYI the cmdlet works perfectly locally on the 2016DSC01 server... ?

    $ForestFQDN = "DEMO-AD.dk"
    $RemoteServerDCServerName = 2016DSC01
    $RemoteServerRDSHostServerName= 2016DSC02

    $PSSession = New-PSSession -ComputerName $RemoteServerDCIPAddress -Credential $DomainAdminCreds
            Invoke-Command -Session $PSSession -ScriptBlock {
                Param
                (
                    [String]$ConnectionBrokerFQDN,
                    [String]$SessionHostFQDN,
                    [String]$WebAccessServerFQDN
                )
                [System.Globalization.CultureInfo]$culture = "en-US"
                [System.Threading.Thread]::CurrentThread.CurrentCulture = $culture
                [System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture
                Import-Module RemoteDesktop
                Get-Module RemoteDesktop
                Try
                {
                    New-RDSessionDeployment -ConnectionBroker $ConnectionBrokerFQDN -SessionHost $SessionHostFQDN -WebAccessServer $WebAccessServerFQDN -ErrorAction Stop
                    Restart-Computer -ComputerName $env:COMPUTERNAME -Force
                }
                Catch
                {
                    $_
                }

            } -ArgumentList $("$RemoteServerDCServerName.$ForestFQDN"), $("$RemoteServerRDSHostServerName.$ForestFQDN"), $("$RemoteServerDCServerName.$ForestFQDN")

    Error returned from the Invoke-Command via the PSSession:

    New-RDSessionDeployment : Validation failed for the "RD Connection Broker" parameter.
    2016DSC01.DEMO-AD.dk   Unable to connect to the server by using Windows PowerShell remoting. Verify that you can connect to the server.
    At line:19 char:17
    + ...             New-RDSessionDeployment -ConnectionBroker $ConnectionBrok ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-RDSessionDeployment

    • Moved by Bill_Stewart Wednesday, July 26, 2017 7:51 PM Abandoned
    Tuesday, June 27, 2017 6:09 PM

Answers