I am running the following command from a PowerShell console on a Windows 8 machine, trying to configure a Server 2012 R2 RDS Connection Broker:
Import-Module RemoteDesktop
Set-RDSessionCollectionConfiguration -CollectionName "Example" -CustomRdpProperty "gatewayhostname:s:rdp.example.com" -ConnectionBroker "ep-ts01.ad.example.com"
However, even though I am specifying which Connection Broker to use, it always tries to connect to localhost
:
New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message : The clie cannot connect to the destination specified in the request. Verify that the service on the destination is running an is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
However, Get-RDSessionCollection -ConnectionBroker ep-ts01.ad.example.com
works just fine and returns the collections.
It's the same story if I do Enter-PSSession ep-ts01.ad.example.com
and run it from there. However if I run the command from the server itself (i.e. not remotely) it works just fine.
How can I fix this?