Solved

Managed connection to Remote Desktop Server with powershell

Posted on 2015-01-08
4
128 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
4 Comments
 
LVL 78

Expert Comment

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

What to do when Windows Update is not working correctly? What tools can I use to detect the cause of the malfunction problem? What does this numeric error code mean? These and other questions that you have been asking in the past are answered here (…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
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…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now