Seany84
Seany84

Reputation: 5596

Re-enable Remote Desktop Windows Firewall Rule on Windows Azure

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).

Upvotes: 0

Views: 5988

Answers (2)

que
que

Reputation: 188

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 :)

Upvotes: 4

Seany84
Seany84

Reputation: 5596

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.

Upvotes: 2

Related Questions