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

Grok 3 est-il l’avenir de l’Intelligence Artificielle ?

Grok 3 est-il l’avenir de l’Intelligence Artificielle ? Elon Musk, le visionnaire derrière SpaceX et…

8 heures ago

Google abandonne le Chromecast : Une page se tourne

Aperçu de la toute première version de Chromecast par Google Le Chromecast, l'un des produits…

1 jour ago

Apple contraint de retirer la protection avancée des données au Royaume-Uni

Apple contraint de retirer la protection avancée des données au Royaume-Uni Un recul inquiétant pour…

2 jours ago

Amazon va arrêter Chime : la fin de son alternative à Zoom

Amazon va arrêter Chime : la fin de son alternative à Zoom Amazon tire un…

3 jours ago

Adobe Firefly Video : L’outil de génération vidéo accessible à tous

Adobe Firefly Video : L’outil de génération vidéo accessible à tous Adobe a récemment annoncé…

1 semaine ago

En France, les messageries chiffrées bientôt sous surveillance : un débat entre sécurité et libertés individuelles

Les messageries chiffrées telles que WhatsApp et Signal pourraient bientôt faire face à des obligations…

3 semaines ago