Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all articles
Browse latest Browse all 1106

Server 2016 and New-RDSessionDeployment via Remote Powershell

$
0
0

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



Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>