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

Microsoft veut centraliser toutes les mises à jour logicielles via Windows Update

Microsoft veut centraliser toutes les mises à jour logicielles via Windows Update Microsoft a récemment…

2 jours ago

Améliorez les performances d’Active Directory avec le format de page 32k sur Windows Server 2025

Améliorez les performances d’Active Directory avec le format de page 32k sur Windows Server 2025…

3 jours ago

HarmonyOS pour PC : Huawei et l’indépendance numérique de la Chine

HarmonyOS pour PC : Huawei et l'indépendance numérique de la Chine HarmonyOS pour PC :…

4 jours ago

Telegram s’associe à xAI pour intégrer Grok et reçoit 300 millions de dollars

Telegram s’associe à xAI pour intégrer Grok et reçoit 300 millions de dollars Introduction Telegram…

6 jours ago

WhatsApp est disponible sur iPad

WhatsApp sur iPad : Une Nouvelle Dimension pour la Communication Introduction L'application WhatsApp sur iPad…

1 semaine ago

L’intégration de Grok dans Azure : Une avancée majeure pour Microsoft

L'intégration de Grok dans Azure : Une avancée majeure pour Microsoft Introduction L'intégration de Grok…

1 semaine ago