Solved

Managed connection to Remote Desktop Server with powershell

Posted on 2015-01-08
4
213 Views
Last Modified: 2016-06-22
I have a remote desktop farm with 6 RD hosts that are running Windows Server 2012. I want to allow and disallow new connection to each server using PowerShell. I found the powershell command that is suppose to do the job, but it does not work.  When I verify in the Server Manager I still see the host server allowing new connections.

Command:
Set-RDSessionHost -SessionHost "RDHost1.domain.local" -NewConnectionAllowed "No" -ConnectionBroker "rdcb.domain.local"

I'm I doing something wrong? I tried running the command from the  RD Broker and host.
0
Comment
Question by:eMarketer75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 40538950
-NewConnectionAllowed $false   not -NewConnectionAllowed "NO"
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 40538992
I have been wondering about the same, but the help tells different. "No" is valid.
0
 

Accepted Solution

by:
eMarketer75 earned 0 total points
ID: 40544940
Thank you for the response.  I was able to fix my problem. When you run the PowerShell command, it does not reflect right away in the Server Manager.  After closing the server manager and re-opening it I see my changes. If I run the Get-RDSessionHost command I get see if new connections are allowed right away.

Get-RDSessionHost -CollectionName “My Collection Name” -ConnectionBroker mybroker.domain.local
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question