Azure Resource Manager – Reset Windows VM Password
If you are looking to reset Windows Virtual Machine Password then today Azure portal though has a link to reset password but the option is yet to come into action. Below are the steps that will reset your password for your account.
Login to Azure PowerShell –
Know Username of Windows VM that needs password reset
(Get-AzureRmVM -ResourceGroupName <RG-Name> -Name <Name-of-VM>).OSProfile.AdminUsername
Know Type handler version to specify in the Password reset command. This tells which version to use for the VM Extension Image.
Get-AzureRmVMExtensionImage -PublisherName Microsoft.Compute -Type VMAccessAgent -Location "your-VM-location"
Next, use below command to reset the Windows VM Password –
$RG = <your-resource-group-name>
$VM = <your-VM-Name>
-Location = <your-VM-Location>
Set-AzureRmVMAccessExtension -ResourceGroupName $RG -VMName $VM -Name <name-for-password-reset-extn> -TypeHandlerVersion "2.0" -Username "sarvesh" -Password "MyNewPassword1" -Location $Location
Once you get success message, you can login to your Windows VM with the new password.