How do I enable Remote Desktop in PowerShell?

Type your search query and hit enter:
All Rights ReservedView Non-AMP Version

ITExperience.NET

Type your search query and hit enter:
  • Homepage
  • Be A Better Sysadmin

Enable RDP on Windows 10 using Powershell

Just a small reminder for myself [and you]:

If you ever need to enable RDP [mstsc] on a Windows 10 machine, and you cant get to the System control panel item, use Powershell to enable RDP:

# Enable Remote Desktop [Get-WmiObject Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices].SetAllowTsConnections[1,1] | Out-Null [Get-WmiObject -Class "Win32_TSGeneralSetting" -Namespace root\cimv2\TerminalServices -Filter "TerminalName='RDP-tcp'"].SetUserAuthenticationRequired[0] | Out-Null Get-NetFirewallRule -DisplayName "Remote Desktop*" | Set-NetFirewallRule -enabled true

Execute aboves cmdlets as Administrator in Powershell, and RDP should work.

To test the connection, open Powershell on another machine, and run:

Test-NetConnection 10.10.1.105 -CommonTCPPort rdp

Result should be as follows:

PS C:\WINDOWS\system32> Test-NetConnection 10.10.1.105 -CommonTCPPort rdp ComputerName : 10.10.1.105 RemoteAddress : 10.10.1.105 RemotePort : 3389 InterfaceAlias : Ethernet SourceAddress : 10.10.1.247 TcpTestSucceeded : True

John van Ooijen
Next IIS AD Group permission - setting up in Windows Server 2016 »
Previous « MSDTC uninstall fails with event 4157 [Could not stop the MS DTC service or or one of its dependent services]
Leave a Comment

    Related Post

  • Automatically open ica file in Chrome and Edge
  • Remove Windows Hello after disabling in Intune
  • All fixes for error caa70004 in Microsoft Teams

Recent Posts

  • General

4 easy ways to take a screenshot on Mac

Taking a screenshot [also called a print screen or screen capture] on your Mac is

2 months ago
  • General

Gaming Services error 0x80073D26 easy fix

The Gaming Services error in the Microsoft Store is a common problem. When you click

3 months ago
  • Windows Tips 'n Tricks

Fix Black page layout in Microsoft Word

Many Microsoft Word users reported that their page layout has suddenly gone black. With the

3 months ago
  • No Errors No Problems

Fix Xerox error 0x800f020b in Windows Update

As of February 2021, many Xerox users are experiencing the Windows Update error 0x800f020b. The

3 months ago
  • Be A Better Sysadmin

Automatically open ica file in Chrome and Edge

If you often work with Citrix sessions, you will probably recognize the following problem. As

7 months ago
  • General

Turn off weather widget in taskbar Windows 10

The Weather widget was introduced in the latest Windows 10 Cumulative Update, June 2021. The

8 months ago
All Rights ReservedView Non-AMP Version

Video liên quan

Chủ Đề