2017-08-30 43 views
0

enter image description here尋找一種方式來配置在PowerShell中

的RDP-TCP屬性有沒有辦法設置在PowerShell中RDP-TCP proerties會話。

+0

如何訪問該對話框? Windows版本/版本? –

+0

是的,你可以 [Microsoft博客] https://blogs.msdn.microsoft.com/powershell/2009/01/09/managing-remote-desktop-services-aka-terminal-services-using-windows-powershell/ – ArcSet

+2

任何你沒有使用GPO配置這些設置的理由? –

回答

0

可以使用RemoteDesktopServices PowerShell的模塊:

Import-Module RemoteDesktopServices 

然後設置斷開的會話,活動會話,空閒會話限制爲一小時使用:

Set-Item ` 
-Path 'RDS:\RDSConfiguration\Connections\Default RDP\SessionTimeLimitSettings\TimeLimitPolicy' ` 
-Value 0 ` 
-IdleSessionLimit 3600000 ` 
-ActiveSessionLimit 3600000 ` 
-DisconnectedSessionLimit 3600000 

瀏覽的RDS Provider可以查看所有選項:

Get-ChildItem RDS: 
  • 示例中的'默認RDP'是我的RDP連接名稱,因此請將其更改爲RDP-Tcp或其他任何連接名稱:
相關問題