2013-09-25 52 views
0

是否可以使用PowerShell配置Remote Desktop for Administrator而不在所有服務器上安裝「遠程桌面會話主機」角色?我們在RemoteDesktopServices模塊之後。使用PowerShell爲管理員配置遠程桌面

該文檔在這裏:http://technet.microsoft.com/en-us/library/cc743159.aspx

「讓行政目的的遠程連接而已,你不必安裝RD會話主機服務器。」

但是使用PowerShell的所有指令似乎都需要額外的角色。這是否有必要,如果有的話,是什麼意思,因爲它似乎是一個更廣泛的功能?

回答

1

使用WMI,你可以不用RDSH(從here複製粘貼&)

$RDP = Get-WmiObject -Class Win32_TerminalServiceSetting ` 
      -Namespace root\CIMV2\TerminalServices ` 
      -Computer $Computer ` 
      -Authentication 6 ` 
      -ErrorAction Stop 

$result = $RDP.SetAllowTsConnections(1,1) 
    if($result.ReturnValue -eq 0) { 
    Write-Host "$Computer : Enabled RDP Successfully" 
    "$Computer : RDP Enabled Successfully" | Out-File -FilePath $SuccessComps -Append 
} else { 
    Write-Host "$Computer : Failed to enabled RDP" 
    "$Computer : Failed to enable RDP" | Out-File -FilePath $FailedComps -Append 
} 
+0

由於C.B。我們正在試圖改變實際設置時間限制政策?雖然我無法在文檔中找到任何內容 - http://msdn.microsoft.com/en-us/library/windows/desktop/aa383640(v=vs.85).aspx - 但我們可以通過它進行更改UI ...有什麼想法? –