I'm trying to script the setup of a remote desktop deployment into Azure. I'm using Powershell remoting to connect to the WinRM endpoint on the VM's and execute remote Powershell. For the most part this works fine and has allowed me to configure teh servers, install applicaitons etc.
However, when I come to actually install the Remote desktop components using the New-RDSessionDeployment command I run into problems. There are 2 servers in this deployment:
- RD-GTW, that will host the remote desktop gateway and web access services
- RD-RDS, that will host a session host and connection broker
I am running the New-RDSessionDeployment command against the RD-GTW server (using invoke-command) as follows
New-RDSessionDeployment -ConnectionBroker RD-RDS.domain.local -WebAccessServer RD-GTW.domain.local -SessionHost RD-RDS.domain.local
This then comes back with an error:
Validation failed for the "RD Connection Broker" parameter.
RD-RDS1.domain.local Unable to connect to the server by using Windows PowerShell remoting. Verify that you
can connect to the server.
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-RDSessionDeployment
+ PSComputerName : ServiceName-svc1.cloudapp.net
Now what I believe is happening here is a problem with the fact that New-RDSessionDeployment its self makes a remote powershell connection that that server, so I have a remote connection making a remote connection, and so see a double hop issue. I have tried setting up CREDSSP authentication to allow for a double hope of credentials between the two, however I don't seem to be able to get this configuration working, as I am running the scripts from a desktop (on my corporate domain) and connecting to servers in Azure, so I think I am missing an SPN or similar, but not sure where.
Any suggestions on whether my assumptions are correct, and what to do about the issue are appreciated.
you neet to run
Enable-PSRemoting
as power-shell command and answer yes to every question