|
In this article, we will show you how to use the Get-AzVM command to check the license type of an Azure VM. We will also tell you about the different license types for Azure VMs. Azure virtual machines (VMs) can be licensed in different ways, like Azure Hybrid Benefit, pay-as-you-go, and Bring Your Own License (BYOL). To know how a particular VM is licensed, you can use the PowerShell command Get-AzVM. This command will show the license type of the VM, and other information like the number of cores licensed and the license expiration date. Steps To Check Azure Virtual Machines License TypeStep 1: Login to Azure Portal with your Microsoft account. Step 2: Access the the Azure Cloud Shell and switch to the PowerShell console. Note: If you are using Windows PowerShell on your local system make sure to use the installed module version of Azure commands. Step 3: Switch to the target Azure subscription where your Azure VM is located. Use this command to switch subscriptions. #For Az Module Users Step 4: Fetch the information of your target Azure Virtual machine. #For Az Module Users Step 5: Now, run this command to print the license type of your Azure virtual machine. $azureVM.LicenseType
This command will return the license type of the VM, which can be one of the following values:
Sample Output 1: If the virtual machine is licensed using Azure Hybrid Benefit then the output looks like this. Sample Output 2: This output is different from the output of a virtual machine (VM) that was deployed without using Azure Hybrid Benefit for Windows Server licensing. Optional: If you want to use this PowerShell cmdlet in a single line, you can use the following command to check the license type of an Azure Virtual Machine: #For Az Module Users Frequently Asked Questions1. What Are The Different Azure VM Licenses?
2. Can We Enable Azure Hybrid Benefits For Azure VM?
3. What Is The Ways To Enable Azure Hybrid Benefit To Azure VM?
|
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |