Solved

Managed connection to Remote Desktop Server with powershell

Posted on 2015-01-08
4
250 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 82

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

635 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