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
Param
(
[String]$ConnectionBrokerFQDN,
[String]$SessionHostFQDN,
[String]$WebAccessServerFQDN
)
[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture
[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture
{
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