简体   繁体   中英

Azure VM password reset

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!

我之前曾多次遇到此问题,对我而言,有效的方法是创建一个新用户,而不是尝试重置旧的本地管理员帐户。

You can reset the password of all Classic VMs ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM