Managing Two Azure VMs from One PowerShell Session

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this hands-on lab, you are tasked with finding system information from multiple VMs using PowerShell. Instead of logging into each server, it’s much easier to perform PowerShell commands from a single terminal. Using the `Enter-AzVM` command, you will be able to access the Azure VM from a PowerShell session and perform all the necessary commands, just as if you were logged into the machine.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Open Cloud Shell and Navigate to Your Resource Group
  1. Open Cloud Shell and open the PowerShell prompt.
  2. Change directory into the resource group for this hands-on lab.
  3. List all VMs.
Enable PowerShell Remoting for Both VMs
  1. Enable PowerShell remoting for the Windows VM.
  2. Enable PowerShell remoting for the Linux VM.
Enter the VM and Get the Memory Utilization
  1. Install module.
  2. Disable certification verification.
  3. Access the Windows VM and verify memory utilization.
  4. Access the Linux VM and verify memory utilization.

Additional Resources

You are tasked with finding the system information from each VM. More specifically, you will need to get the memory utilization. In order to do this, you must first set up PowerShell Remoting on each VM.

In order to complete this hands-on lab, perform the following:

  • Open the Azure Cloud Shell and open the PowerShell prompt. Make sure to use the same location as your lab provided resource group.
  • Enable a remote PowerShell session over SSH protocol for Linux.
  • Enable a remote PowerShell session over https (winrm) protocol for Windows.
  • Access the VM using the Enter-AzVM command.
  • Perform the command to obtain the system memory utilization.

Note: Due to a bug, in order to connect to the VMs, certificate verification must be disabled for now. See the lab guide for details.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?