Azure VM Password Reset is Failing

Manojkumar Palanisamy 1 Reputation point
2021-11-07T21:42:04.51+00:00

When I try to reset the password in Azure Portal, I keep getting the following error and am unable to reset the password. Any Suggestions?

147144-failure.png

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,055 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Prrudram-MSFT 28,366 Reputation points Microsoft Employee Moderator
    2021-11-08T06:10:17.913+00:00

    In addition to my comment earlier, this specific issue could happen during azure VM password reset, if the VMAgent extension is broken or not installed or Remote Desktop related services are not running..

    Incase there is no issue with VMAgent Extension, and If portal continues to throw the same error, you can leverage AzureCLI to reset the password using the following cmdlets

    azure login  
    azure config mode arm  
    azure vm reset-access -g <<RESORCE_GROUP_NAME>> -n <<VM_NAME>> -u <<USER>> -p <<PASSWORD>>  
    

    Reference : https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/vmaccess#reset-password

    An Alternative Solution:

    If the Azure VM access extension doesn't respond and you're unable to reset the password, you can reset the local Windows password offline. This method is more advanced and requires you to connect the virtual hard disk of the problematic VM to another VM. Follow the steps documented in this article, and attempt the offline password reset method only if the first suggested steps don't work.
    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/reset-local-password-without-agent

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    1 person found this answer helpful.
    0 comments No comments

  2. Prrudram-MSFT 28,366 Reputation points Microsoft Employee Moderator
    2021-11-10T06:13:54.517+00:00

    @Manojkumar Palanisamy

    Thank you for sharing the information and for providing error details.

    Yes, there is a way to manually install extensions on VMs. Which is PowerShell method

    Several PowerShell commands exist for running individual extensions. To see a list, use Get-Command and filter on Extension:

    Note : Ensure you have Azure Az modules installed

    Login to Azure account using Connect-AzAccount

    Then run
    Get-Command Set-AzVMAccessExtension -Module Az.Compute

    The Set-AzVMAccessExtension cmdlet adds the Virtual Machine Access (VMAccess) Virtual Machine VMAccess Extension to a virtual machine

    Example : Set-AzVMAccessExtension -ResourceGroupName "ResourceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "2.4" -UserName "PFuller" -Password "Password"

    The above command adds a VMAccess extension for the virtual machine named VirtualMachine07 in ResourceGroup11. The command specifies the name and type handler version for VMAccess.
    For more details refer to :
    https://learn.microsoft.com/en-us/powershell/module/az.compute/set-azvmaccessextension?view=azps-6.6.0
    https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/features-windows#powershell

    Post installing the extension successfully, you could try password reset again..

    Hoping this helps..

    1 person found this answer helpful.
    0 comments No comments

  3. Manojkumar Palanisamy 1 Reputation point
    2021-11-09T23:14:18.57+00:00

    Thank you @Prrudram-MSFT for your response.

    The issue is still not resolved. I am still receiving the following error if I reset from CLI. I can confirm that 'enablevmaccess' is not configured in VM. Is there any way to manually configure this extension?

    I am unable to login to VM as the password is forgotten.

    Error

    (VMExtensionProvisioningError) VM has reported a failure when processing extension 'enablevmaccess'. Error message: "Cannot update Remote Desktop Connection settings for Administrator account. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.

    --- End of inner exception stack trace ---
    at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.WindowsUser.SetPassword(SecureString password)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.RemoteAccessAccountManager.AddOrUpdateRemoteUserAccount(String userName, SecureString password)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.JsonExtensions.VMAccess.VMAccessExtension.OnEnable()"

    More information on troubleshooting is available at https://aka.ms/vmextensionwindowstroubleshoot
    Code: VMExtensionProvisioningError
    Message: VM has reported a failure when processing extension 'enablevmaccess'. Error message: "Cannot update Remote Desktop Connection settings for Administrator account. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.

    --- End of inner exception stack trace ---
    at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.WindowsUser.SetPassword(SecureString password)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.RemoteAccessAccountManager.AddOrUpdateRemoteUserAccount(String userName, SecureString password)
    at Microsoft.WindowsAzure.GuestAgent.Plugins.JsonExtensions.VMAccess.VMAccessExtension.OnEnable()"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.