|
| 1 | +--- |
| 2 | +title: Apply Windows license to session host virtual machines - Azure |
| 3 | +description: Describes how to apply the Windows license for Windows Virtual Desktop VMs. |
| 4 | +services: virtual-desktop |
| 5 | +author: ChristianMontoya |
| 6 | + |
| 7 | +ms.service: virtual-desktop |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 08/14/2019 |
| 10 | +ms.author: chrimo |
| 11 | +--- |
| 12 | +# Apply Windows license to session host virtual machines |
| 13 | + |
| 14 | +Customers who are properly licensed to run Windows Virtual Desktop workloads are eligible to apply a Windows license to their session host virtual machines and run them without paying for another license. For more information, see [Windows Virtual Desktop pricing](https://azure.microsoft.com/pricing/details/virtual-desktop/). |
| 15 | + |
| 16 | +## Ways to use your Windows Virtual Desktop license |
| 17 | +Windows Virtual Desktop licensing allows you to apply a license to any Windows or Windows Server virtual machine that is registered as a session host in a host pool and receives user connections. This license does not apply to virtual machines that are running as file share servers, domain controllers, and so on. |
| 18 | + |
| 19 | +There are a few ways to use the Windows Virtual Desktop license: |
| 20 | +- You can create a host pool and its session host virtual machines using the [Azure Marketplace offering](./create-host-pools-azure-marketplace.md). Virtual machines created this way automatically have the license applied. |
| 21 | +- You can create a host pool and its session host virtual machines using the [GitHub Azure Resource Manager template](./create-host-pools-arm-template.md). Virtual machines created this way automatically have the license applied. |
| 22 | +- You can apply a license to an existing session host virtual machine. To do this, first follow the instructions in [Create a host pool with PowerShell](./create-host-pools-powershell.md) to create a host pool and associated VMs, then return to this article to learn how to apply the license. |
| 23 | + |
| 24 | +## Apply a Windows license to a session host VM |
| 25 | +Make sure you have [installed and configured the latest Azure PowerShell](/powershell/azure/overview). Run the following PowerShell cmdlet to apply the Windows license: |
| 26 | + |
| 27 | +```powershell |
| 28 | +$vm = Get-AzVM -ResourceGroup <resourceGroupName> -Name <vmName> |
| 29 | +$vm.LicenseType = "Windows_Client" |
| 30 | +Update-AzVM -ResourceGroupName <resourceGroupName> -VM $vm |
| 31 | +``` |
| 32 | + |
| 33 | +## Verify your session host VM is utilizing the licensing benefit |
| 34 | +After deploying your VM, run this cmdlet ot verify the license type: |
| 35 | +```powershell |
| 36 | +Get-AzVM -ResourceGroup <resourceGroupName> -Name <vmName> |
| 37 | +``` |
| 38 | + |
| 39 | +A session host VM with the applied Windows license will show you something like this: |
| 40 | + |
| 41 | +```powershell |
| 42 | +Type : Microsoft.Compute/virtualMachines |
| 43 | +Location : westus |
| 44 | +LicenseType : Windows_Client |
| 45 | +``` |
| 46 | + |
| 47 | +VMs without the applied Windows license will show you something like this: |
| 48 | + |
| 49 | +```powershell |
| 50 | +Type : Microsoft.Compute/virtualMachines |
| 51 | +Location : westus |
| 52 | +LicenseType : |
| 53 | +``` |
| 54 | + |
| 55 | +Run the following cmdlet to see a list of all session host VMs that have the Windows license applied in your Azure subscription: |
| 56 | + |
| 57 | +```powershell |
| 58 | +$vms = Get-AzVM |
| 59 | +$vms | ?{$_.LicenseType -like "Windows_Client"} | select ResourceGroupName, Name, LicenseType |
| 60 | +``` |
0 commit comments