Re-enable Remote Desktop Windows Firewall Rule on Windows Azure
Asked Answered
C

2

0

I have disabled the remote desktop firewall rule in a Windows Azure virtual machine.As you would expect, I can no longer remote desktop in to the server.

Does anyone know if it is possible to re-enable the Remote Desktop Windows firewall rule?

What I have tried

As a long shot, I have downloaded the Windows Azure CLI but can't see anything in there that would do it but have not found anything.

I have also tried to execute the following command against the MSSQL server:

EXEC xp_cmdshell 'netsh advfirewall firewall set rule group="remote desktop" new enable=Yes';
GO

I am getting the following message from the query:

The requested operation requires elevation (Run as administrator).

Please tell me I don't have to re-create the site (which is backed up).

Colicroot answered 4/10, 2013 at 23:22 Comment(0)
C
2

It turns out that all I needed to do was to PowerShell into the Azure VM.

Steps:

  • Make sure PowerShell is enabled in the Endpoints section of the Azure portal.
  • Get the server's certificate (PowerShell needs this for remote commands). You can get the server certificate by going to your domains' URL: https://yourdomaing.cloudapp.net:12345 (where :12345 is the port that PowerShell uses).
  • Export the SSL certificate of the site as a .CER file and install it on your local machine.
  • Save it to the "Trusted Root Certification Authorities" store on your machine.
  • Open PowerShell with administrative privileges on your local machine and type: Enter-PSSession -ComputerName yourdomain.cloudapp.net -Port 5986 -Credential YourUserName -UseSSL
  • A login popup will appear, enter your VM's login credentials here.
  • You will now be able to execute commands against the Azure VM. In my case, I ran netsh advfirewall firewall set rule group="remote desktop" new enable=Yes and exited the PowerShell session and was able to remotely connect to my machine.
Colicroot answered 7/10, 2013 at 23:17 Comment(0)
A
4

If you're using a VM inside a resource group with the new azure portal, you can do this:

  1. Click reset password

Click "Reset password"

  1. Change mode to "Reset configuration only" Change mode to "Reset configuration only"

  2. Click update and wipe your sweat off :)

Additory answered 2/3, 2017 at 17:54 Comment(2)
That's great now that it can be done from the Azure portal. However, this was not the case back in 2013.Colicroot
Yes, but there was very little info on google about how to do this from the new portal. So I thought I'd add it.Additory
C
2

It turns out that all I needed to do was to PowerShell into the Azure VM.

Steps:

  • Make sure PowerShell is enabled in the Endpoints section of the Azure portal.
  • Get the server's certificate (PowerShell needs this for remote commands). You can get the server certificate by going to your domains' URL: https://yourdomaing.cloudapp.net:12345 (where :12345 is the port that PowerShell uses).
  • Export the SSL certificate of the site as a .CER file and install it on your local machine.
  • Save it to the "Trusted Root Certification Authorities" store on your machine.
  • Open PowerShell with administrative privileges on your local machine and type: Enter-PSSession -ComputerName yourdomain.cloudapp.net -Port 5986 -Credential YourUserName -UseSSL
  • A login popup will appear, enter your VM's login credentials here.
  • You will now be able to execute commands against the Azure VM. In my case, I ran netsh advfirewall firewall set rule group="remote desktop" new enable=Yes and exited the PowerShell session and was able to remotely connect to my machine.
Colicroot answered 7/10, 2013 at 23:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.