Networknet archive Blog

PowerShell: Enable Remote Desktop

Originally published 3 comments

By Ivan Versluis

I am creating an SCCM task sequence to deploy a Windows Server 2012 R2 image. The task sequence has completed and loaded the image, and I now want to connect with my RDP client. These PowerShell commands automate the Remote Desktop configuration that must be enabled first:

PowerShell3 lines
1
2
3
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 0

Enable-RemoteDesktop

3 comments

Comments from the original WordPress site, kept read-only.

  1. Raed

    Hi IVAN,

    What stage I should apply this Powershell Task sequence , is it after apply operating system ?

    Thank you.

  2. Aneesh

    Whether this can be applied for Windows 10 OS deployment.
    Can you please be specific about where to keep the powershell script task sequence in the Windows OS deployment task sequence.