question

ManojkumarPalanisamy-8472 avatar image
0 Votes"
ManojkumarPalanisamy-8472 asked Prrudram-MSFT answered

Azure VM Password Reset is Failing

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
failure.png (87.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ManojkumarPalanisamy-8472

Thank you for reaching out for the help on this issue.

As to your query posted here,
You forgot the password of the user? Or do you just want to change the password of the user?
If you just want to change the password of the user you can do this via Computer Management or if the VM is domain joined via AD..

0 Votes 0 ·
Prrudram-MSFT avatar image
1 Vote"
Prrudram-MSFT answered Prrudram-MSFT edited

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://docs.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://docs.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)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ManojkumarPalanisamy-8472 avatar image
0 Votes"
ManojkumarPalanisamy-8472 answered

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()"

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Prrudram-MSFT avatar image
1 Vote"
Prrudram-MSFT answered

@ManojkumarPalanisamy-8472

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://docs.microsoft.com/en-us/powershell/module/az.compute/set-azvmaccessextension?view=azps-6.6.0
https://docs.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..




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.