How to Reset Password for VMSS (Scale Set) Instances


Symptom:

Unable to RDP to a Virtual Machine Scale Set Instance (VMSS) due to an incorrect password

Resolution:

  1. If Azure PowerShell is not installed, install it from http://azure.microsoft.com/en-us/downloads/
  2. Open up PowerShell ISE as an Administrator
  3. Paste the following script into the Window modifying each of the all CAPS portions:

    Login-AzureRmAccount
    Get-AzureRmSubscription -SubscriptionId ‘SUBSCRIPTIONID’ | Select-AzureRmSubscription

    $vmssName = ‘SCALESETNAME’
    $vmssResourceGroup = ‘SCALESETRESOURCEGROUP’
    $publicConfig = @{‘UserName’ = ‘USERNAME’}
    $privateConfig = @{‘Password’ = ‘NEWPASSWORD.’}
    $extName = ‘VMAccessAgent’
    $publisher = ‘Microsoft.Compute’
    $vmss = Get-AzureRmVmss -ResourceGroupName $vmssResourceGroup -VMScaleSetName $vmssName
    vmss = Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Name $extName -Publisher $publisher -Setting $publicConfig -ProtectedSetting $privateConfig -Type $extName -TypeHandlerVersion ‘2.0’ -AutoUpgradeMinorVersion $true

    Update-AzureRmVmss -ResourceGroupName $vmssResourceGroup -Name $vmssName -VirtualMachineScaleSet $vmss

  4. Navigate to the Azure Portal and select the VM Scale Set
  5. Select Instances
  6. You should see that all the instances are not updated to the Latest Model
    1
  7. Check all the boxes of the instance you wish you update with the new username and password
  8. Select Upgrade
    2
  9. After a few mins (Depending on the number of instances you updated) you should see the Latest Model change to Yes
    3
  10. You can now login to the Scale Set VMs using the new Username and Password

Comments (0)

Skip to main content