Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
636 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How would I go about using the below script to enable multiple vms instead of one at a time?
$vm = Get-AzVM -ResourceGroup "rg-name" -Name "vm-name"
$vm.LicenseType = "Windows_Server"
Update-AzVM -ResourceGroupName rg-name -VM $vm
Hi @DeHaven Graham ,
You can do the bulk changes for all VM's under a resource group with the help of below script.
$VMs = Get-AzVM -ResourceGroupName xxxxxxxxxxxxxx | ?{$_.StorageProfile.OsDisk.OsType -eq "Windows"}
foreach ($VM in $VMs){
$VM.LicenseType = "Windows_Server"
Update-AzVM -ResourceGroupName xxxxxxxxxxxxxx -resources -VM $VM
}
Illustration:
In the same way,
Let me know if you need any further clarification.