Categories: AzureEnglish

Connecting to a Windows Azure VM in Remote PowerShell

Accessing to you virtual machine is easy when you just need a RDP connection.

But, you may want to connect to you Azure virtual machine thanks to Remote PowerShell.

Part  1 – Accessing to a Azure Virtual Machine by Remote PowerShell

When you want to access to a remote VM thanks to PowerShell, you can do this with standard PowerShell prompt or with the improved prompt called « Windows PowerShell ISE ».

When you open, Windows PowerShell ISE, you can reach in the top menu and select New Remote PowerShell Tab.

On the next window, you can specify the name or public IP address of your virtual machine and the login that you want to use and press Connect. It will ask you for you password of the specify account.

If you want to do the same with the standard PowerShell prompt. You can use the following CmdLet :


Enter-PSSession -ComputerName yourvm.cloudapp.net -Credential login

You can also precise the parameter -Port XXXX if you don’t use a standard port number. To check the public port for Remote PowerShell on Windows Azure, you can go in the parameters of your virtual machine then in « Terminaison points » you will get the port number. By default, it’s 5986.

If you tried the 2 previous possibilities to connect yourself to a Azure virtual machine. You may encounter some errors.

Part 2 – Troubleshooting

We will assume you have already created a VM in order to test the next steps.

To make the connection works, you just need to get the certificate of you Azure Virtual Machine and use SSL connection when you Enter-PSSession CmdLet.

First, the more difficult way, you reach the web URL of your virtual machine. My VM is called « akril » so it’s name will be by default :

  • https://akril.cloudapp.net:5986/

On Chrome, you can click on the lock at the left of the URL to get more information about this certificate…

Copy the certificate on your desktop and install it under Trusted Root Certification Authorities.

The certificate is correctly installed, you can now launch the following command to connect to your virtual machine :


Enter-PSSession -ComputerName yourvm.cloudapp.net -Credential login -UseSSL

You are not successfully connected to your virtual machine in PowerShell !

Original article from Fabric Controller.

Part 3 – Remove the certificate

If you want to remove the certificate for any reasons, you just have to start a mmc.exe console. Add the snap-in Certificates and you will find your certificate here.

Just right-click on it ant select Delete.

Share
Published by
thibault

Recent Posts

Google Chrome bloque uBlock Origin : Quand la sécurité masque des intérêts commerciaux

Google Chrome bloque uBlock Origin : Quand la sécurité masque des intérêts commerciaux Depuis début…

4 semaines ago

Vie privée préservée : l’Assemblée rejette les portes dérobées

Vie privée préservée : l'Assemblée rejette les portes dérobées L'Assemblée nationale française rejette la mise…

4 semaines ago

Microsoft abandonne Remote Desktop Connection au profit de la Windows App

Microsoft abandonne Remote Desktop Connection au profit de la Windows App Microsoft a récemment annoncé…

1 mois ago

Google contraint de vendre Chrome après une décision antitrust

Google contraint de vendre Chrome après une décision antitrust Le département américain de la Justice…

1 mois ago

L’évolution de la technologie et le déclin des plateformes numériques

Illustration - Image générée par IA L'avancement technologique a radicalement transformé notre façon de communiquer,…

1 mois ago

Discord prépare son entrée en Bourse : une nouvelle ère pour la plateforme des gamers

Depuis sa création en 2015, Discord est devenue une plateforme incontournable dans le monde du…

1 mois ago