Microsoft

How to Enable Remote Desktop (RDP) Remotely Using PowerShell

Imagine about a situation where you cannot access your virtual machines through VM console and there is no RDP enabled and your Critical Application is Down .Recently I faced this challenge  and was not able to open windows 2012 R2 VM console from vSphere Web and  Thick Client and Application Down , its happened After windows update and VMware update . I tried from server manager option enable and RDP  and that option also grayed out from DC , Finally i used power shell to enable RDP  .

You can remotely enable Remote Desktop (RDP) on the server  using Powershell from DC or any other server which is reachable to the target server . Here we are using Windows 2012 R2 platform.

Enable RDP Remotely Using PowerShell

First of all we need to establish a session with the remote server by following below command and it will prompt for the password , and you have type the password to get access

Establish a session with Remote Session

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

Note :- You can see from screen as connection established and session is with the Server Name [VMARENA-BKP-01] : PS

Enable Remote Desktop

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0

Activate the firewall rule

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

Enable authentication via RDP

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1

Now try to do a Remote Desktop session , it will work .

Rajesh Radhakrishnan

Recent Posts

NAKIVO Backup & Replication v10.8 Released With New Features

Nakivo has released its new Backup and Replication solution Nakivo v10.8, which includes support for…

2 years ago

Oracle Cloud VMware Solution and Features

Oracle Cloud VMware Solution (OCVS) provides a customer-managed, native VMware-based cloud environment hosted in Oracle…

2 years ago

Vinchin Backup and Recovery Review

Vinchin is a professional provider of data protection solutions for enterprises. It provides a series…

2 years ago

VMware Cloud Disaster Recovery (VCDR) Solution Deployment And Configuration Part 2

In my previous blog post, I have explained about VMware Cloud Disaster Recovery (VCDR) Onboarding and…

2 years ago

How to Deploy vRNI Cloud With VMC on AWS

vRealize Network Insight helps you build an optimized, highly available, and secure network infrastructure across…

2 years ago

This SysAdmin Day, WIN with Hornetsecurity!

Can you believe it's here again? SysAdmin Day is back, and with it comes endless gratitude…

2 years ago