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

Les comptes Microsoft sans mot de passe : une révolution sécuritaire en 2025

Les comptes Microsoft sans mot de passe Dans un monde où la sécurité numérique est…

9 heures ago

Pourquoi OpenAI renonce à se restructurer en société à but lucratif : 3 raisons clés

Pourquoi OpenAI renonce à se restructurer en société à but lucratif OpenAI renonce à se…

3 jours ago

Sécurité des messageries chiffrées : Pourquoi Telegram et Signal menacent de quitter la France

Sécurité des messageries chiffrées : Pourquoi Telegram et Signal menacent de quitter la France La…

4 jours ago

5 Alternatives à OneDrive pour le Stockage et le Partage de Documents en Ligne

5 alternatives à OneDrive pour le stockage et le partage de documents en ligne Dans…

5 jours ago

eSIM Android : Google facilite la sauvegarde et le transfert

eSIM Android : Google Facilite la Sauvegarde et le Transfert L'eSIM Android est sur le…

6 jours ago

Spotify et Apple : La fin d’une commission de 30% Révolutionne l’Économie des Applications

Spotify et Apple : La fin d'une commission de 30% Révolutionne l'Économie des Applications Après…

1 semaine ago