1
votes

I have 2 Azure Virtual machines in 1 network and Domain. My Domain Users/Administrators password expired and i forgot built-in login/password for these VM's.

I tried like 30 times on (both VM), to change/reset password of users by using AzureVMAccessExtension, with correct new (long and difficult) password.

PS script:
$vmName = "" 
$serviceName = "" 
$newAdminUserName = "" 
$newAdminPassword = "" 

$vmc = Get-AzureVM -ServiceName $serviceName -Name $vmName 
$vmc | Set-AzureVMAccessExtension -UserName $newAdminUserName -Password $newAdminPassword 
$vmc | Update-AzureVM
Restart-AzureVM -ServiceName $serviceName -Name $vmName  

Still cant login.

I even tried to run remote power shell script "Enable-PSSession", to change RDP policy, but the access was denied.

Any suggestions?

Thanks!

2

2 Answers

0
votes

I had this problem several times before and what worked for me was to create a new user instead of trying to reset the old local administrator account.

0
votes

You can reset the password of all Classic VMs i.e. the VMs created via old ASM portal via going to New ARM Azure Portal. Then find your VM on the Virtual Machines -Classic blade, and go to the settings and select Password Reset option. I have seen this to work even when PowerShell cmdlets fail for this particular operation.

For new VMs created via ARM portal, the support for password reset is not there in the portal but will be coming soon.