windows server powershellでRD セッションホストサーバーの接続を許可する

windows server powershellでRD セッションホストサーバーの接続を許可する

windows serverで、powershellを使用して、RD セッションホストサーバーの接続を許可するコマンドを記述してます。

環境

  • OS windows server 2012 R2

コマンド

以下のコマンドで可能です。

> Set-RDSessionHost -SessionHost セッションホスト名 -NewConnectionAllowed Yes

「No」にすると、接続拒否になります。

> Set-RDSessionHost -SessionHost セッションホスト名 -NewConnectionAllowed No

現在のステータスは以下で確認することが可能です。

> Get-RDSessionHost -CollectionName "Remote Desktop"

CollectionName              SessionHost     NewConnect
                                            ionAllowed
--------------              -----------     ----------
Remote Desktop              xxxx                No
Remote Desktop              xxxx                Yes
Remote Desktop              xxxx                Yes