Solved

Managed connection to Remote Desktop Server with powershell

Posted on 2015-01-08
4
200 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 80

Expert Comment

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

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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