Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

enter image description here

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?

share|improve this question
    
Is your 2012 machine setup for PSRemoting properly? From an administrator powershell window on your 2012 machine run Enable-PSRemoting -Force to be certain the correct services are configured/running and the appropriate firewall rules (if applicable) are enabled. –  bentek Sep 24 '14 at 23:30
    
@BenFernandes yeah, fairly sure it is. Everything else with PS remote sessions is working fine. –  Mark Henderson Sep 24 '14 at 23:31

1 Answer 1

Mark, I had a lot of fun tracking this down for you. I can totally see where your line of thought is, but you're asking the wrong question. The question should be "Why can't I establish a 'servermanagerworkflows' session on my machine?"

If you look in the $enf:systemroot\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop and open the SessionCollectionProperties.psm1 module and jump to line 383 there's an entry where Microsoft is intentionally trying to create a local session using the Microsoft.Windows.ServerManagerWorkflows configuration. After the session is instantiated the magic happens in the following Try/Catch/Finally blocks.

If you ran $session = New-PSSession -ConfigurationName microsoft.windows.servermanagerworkflow in a PS prompt on it's own, I'm betting you'd get the same error. To reinforce this, run Get-PSSessionConfiguration | Select Name and I'll bet you don't see microsoft.windows.servermanagerworkflows as part of the list. So, next step is to get you the session config you need.

Run Register-PSSessionConfiguration -Name Microsoft.Windows.ServerManagerWorkflows cmdlet and agree to the prompts. If successful run Get-PSSessionConfiguration again and see if the workflows are listed. If they are, you should be good to go, or at least generate a new set of errors.

Cheers!

share|improve this answer
1  
Oh wow. That's deep. I will try this out as soon as I can! –  Mark Henderson Nov 15 '14 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.