• Contact Us
  • About Us
  • Privacy Policy

TrustGuide

Guides and hows, tips for everyone

  • Home
  • Windows
  • Android
  • IT
    • Programming language
  • FaceBook
  • iPhone
  • Chrome
  • Photoshop

How To Remotely Enable Remote Desktop Using Powershell- Solved!

October 4, 2022 by davidmr Leave a Comment

When you want to enable Remote Desktop functionality, the easiest method is to use the GUI by directly accessing your computer locally and enabling RDP. However, this method will be useless if you are not at the office and want to activate it remotely.

In this case, using Powershell will bring success beyond your expectations. 

Our TrustGuide team will give you a detailed guide on how to remotely enable remote Desktop using Powershell. So please scroll down and don’t miss any of our news!

How To Remotely Enable Remote Desktop Using PowerShell

For successful enable via Powershell, your remote computer must first meet some strict criteria. These include the WinRM service, administrative rights (on the remote computer), the Advanced Security firewall, and Windows Defender in the off state, enabling remote access via Powershell.

https://www.ctrl.blog/media/hero/remote-desktop-connection-home-house.jpeg

Enabling Remote Desktop using Powershell will certainly cause many difficulties whether you are a newcomer or a person with a lot of experience because it requires a lot of complex implementation processes and a high level of expertise. Therefore, follow our detailed instructions for the smoothest connection on your computer.

Step 1. Enable Remote Connection Using PowerShell

Open a Powershell console on your computer, then run the command below to request a connection to the remote server:

Enter-PSSession -ComputerName server.domain.local -Credential domain administrator

Then it would be best if you edited the fDenyTSConnections parameter by changing it from “1” to “0”. Write the command below to enable RDP and disable the Windows firewall:

Set-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Terminal Server’-name”fDenyTSConnections”-Value 0.

Step 2. Connect RDP to Windows Firewall

To allow connections from RDP to travel to the server’s firewall by executing the command below:

Enable-NetFirewallRule -DisplayGroup “Remote Desktop”.

If you get a missing firewall rule message, fix it by running a manual command with the formula:

netsh advfirewall firewall add rule name =” allow RemoteDesktop “dir = in protocol = TCP localport = 3389 action = allow.

Smart devices and external servers are sometimes “mistakenly connected” to the Remote Desktop, causing unstable transmission. You are best off restricting these connections by running a separate custom rule which only accepts RDP connections coming from specific IP addresses via this command:

New-NetFirewallRule -DisplayName“ Restrict_RDP_access “-Direction Inbound -Protocol TCP -LocalPort 3389 -RemoteAddress 192.168.1.0/24,192.168.2.100 -Action Allow.

Then enable the RDP authentication by entering this command:

Set-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp’ -name”UserAuthentication” -Value 1.

After completing the above operation, you have successfully set the state of RDP on the remote server. It allows you to make remote connections through the RDP client or mstc.exe.

Step 3. Add User to Local Remote Desktop Users

Normally, only users from the Local Administrator can make remote connections. These administrators can allow non-administrators to enable RDP by adding them to Local Remote Desktop Users.

For users using the “jdoe” domain, you need to add them to the group using the Enter-PSSession command:

net localgroup “remote desktop user” / add “test\jdoe”

Also, another PowerShell removal command that you can refer to is:

Invoke-Command -Scriptblock {net localgroup “remote desktop users” / add “test\jdoe”} -Computer server.test.com “.

How Do You Check Whether RDP Is Enabled Or Not Using PowerShell?

https://upload.wikimedia.org/wikipedia/commons/3/31/Best-RDP-21_%281%29.png

To check if your RDP is enabled or not, enter the command:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server and go to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services.

Then, the value of the key fDenyTSConnections will appear on the screen immediately after the command is completed. If the value shows “0”, RDP is enabled. If the display shows “1”, RDP is still off.

FAQS

How Do You Access A Computer Remotely That Is Off?

Để kết nối với computer đang trong trạng thái off, bạn sẽ cần đăng nhập vào the remote access computer. Sau đó, hãy chọn “Connect” nếu máy tính đang trực tuyến hoặc “Send WOL” nếu máy tính ngoại tuyến.

Does RDP Wake-on-LAN?

Unfortunately, the answer is definitely NO. Remote Desktop does not provide any wake-on LAN capabilities.

You will need to use Wake-on-Lan to wake the computer from sleep. Then turn on the “WOL” function, check the hardware, and ensure that the computer’s network supports Wake-on-LAN.

Can RDP Work Without VPN?

Sure! You can establish connections from your on-premises computers and remote servers without help from a VPN.

Final Verdict

Using Powershell to connect to and control the server remotely will certainly cause inexperienced users a bit of trouble in the first few steps. Although it will take some of your time, it will allow secure remote access without any security issues.So, how to remotely enable Desktop using Powershell most effectively? We hope you can conquer this challenge with unexpected success through this article. Wishing you the best remote working experience with our Powershell server connection process. See you in the next articles.

Filed Under: Guideline

Leave a Reply Cancel reply

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

Recent Posts

  • Office 365 Active Directory Sync: Instructions Revealed!
  • How Does Powershell Delete Ad User? The Truth Revealed! 
  • How To Disable MFA Office 365? Easy Tips and Tricks! 
  • How To Setup Ldapsearch Windows Using AD LDS- Solved!
  • Exchange 550 5 7 1 Resolver RST Authrequired Authentication Required- Solved!

Copyright © 2023 · TrustGuide.net · Log in