Activate the remote desktop from a remote computer

Share

It is sometimes useful to access remote PCs in RDP, I occasionally have to uninstall the SCCM client on a remote computer and sometimes for one reason or another, the access to the office is remote turns off.

Activate via PowerShell

  1. Open a PowerShell guest and enter the following command:
Enter-PSSession -ComputerName -Credential

2. Enter the following command:

Set-ItemProperty 'HKLM: \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server \' -Name “fDenyTSConnections” -Value 0

3. Activate authentication

Set-ItemProperty 'HKLM: \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server \ WinStations \ RDP-Tcp \' -Name “UserAuthentication” -Value 1

4. Activate incoming RDP traffic at the Firewall

Enable-NetFirewallRule -DisplayGroup “Remote Desktop”

5. If you want to authorize a non Admin user, enter the following command:

Add-LocalGroupMember -Group "Remote Desktop Users" -Member

Activate via PowerShell and WMI

  1. Open a PowerShell guest and enter the following command:
Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root \ CIMV2 \ TerminalServices -Computer -Authentication 6

2. Activate incoming RDP traffic at the Firewall

(Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root \ CIMV2 \ TerminalServices -Computer -Authentication 6) .SetAllowTSConnections (1,1)

Hope these commands can save you in certain situations 😉


Share

Steven Bart

Founder of StevenBart.com - Vevey, Switzerland. I have been in IT since 2001, I work as a Workplace Architect and mainly deal with the administration of MEMCM (SCCM), the mass deployment of workstations and applications. Learn more about me.

    One thought on “Activate the remote desktop from a remote computer"

    • The Get-WmiObject command to enable incoming RDP at the Firewall level was very useful!

      Goods.

      Reply

    Leave a comment

    Your email address will not be published. Required fields are marked with *