13

The virtual machines on Windows Azure allow to connect from RDP. But how can I reset the administrator password if the password has been lost?

Joannes Vermorel
  • 493
  • 2
  • 5
  • 13

4 Answers4

12

There is an option now in https://portal.azure.com/ You need to log in with your Azure credentials. Browse -> Virtual Machines -> Select Your Virtual Machine -> Select Setting on top -> Password Reset

QADeveloper
  • 236
  • 2
  • 2
  • 2
    Would you mind adding a few pictures I am at settings but i don't see anything about resetting the password. – DaImTo Aug 19 '15 at 10:49
  • After you click on the Virtual Machine, click on "Diagnose and solve problems" and scroll down to the "Tools" section. The "Reset password" link is under there. – Captain Delano Jul 18 '17 at 20:05
  • What is the difference between changing the password inside the VM vs via portal(as you showed?) ? – Blue Clouds Aug 02 '21 at 11:38
5

https://portal.azure.com/# > on left, "Virtual machines" and not Virtual machines (classic) > line with your VM > Reset password at bottom of middle column, under SUPPORT + TROUBLESHOOTING > Eureka!

Takes a minute or so.

Doug Null
  • 236
  • 1
  • 3
  • 10
3

Actually you can with PowerShell's help. For more details read "Microsoft Azure Virtual Machines: Reset Forgotten Admin Passwords with Windows PowerShell".

Import-Module Azure

$subscriptionName = "Windows Azure MSDN - Visual Studio Ultimate"
$cloudSvcName = "ChangeThisWithYourVMServiceName"
$VMname = "ChangeThisWithYourVMName"

Select-AzureSubscription -Current $subscriptionName
Get-AzureSubscription | Format-Table –Property SubscriptionName
$adminCredentials = Get-Credential -Message "Enter new credentials"
$virtualMachine = Get-AzureVM -ServiceName $cloudSvcName -Name $VMname
    If ($virtualMachine.VM.ProvisionGuestAgent) {
        Set-AzureVMAccessExtension -VM $virtualMachine `
            -UserName $adminCredentials.UserName `
            -Password $adminCredentials.GetNetworkCredential().Password `
            -ReferenceName "VMAccessAgent" | 
        Update-AzureVM
        Restart-AzureVM -ServiceName $virtualMachine.ServiceName -Name $virtualMachine.Name
    } else {
        Write-Output "$($virtualMachine.Name): VM Agent Not Installed"
    }
Cristian Ciupitu
  • 6,396
  • 2
  • 42
  • 56
cilerler
  • 151
  • 7
  • 2
    It will work only if provision agent is installed. If you do not have provision agent installed you are screwed. – MRG Jul 06 '14 at 13:35
  • I got problems with the `Select-AzureSubscription` and followed this advice to store my credentials: http://stackoverflow.com/questions/22817539/argumentnullexception-get-azureservice For those how are unsure what the variables should look like: Just issue `Get-AzureVM` and a listing of all VMs is shown – Sebastian J. Jan 16 '15 at 17:15
2

There is no way to do this now, but you can get the data off of the drive if you need to. Please see the Microsoft answer here: http://social.msdn.microsoft.com/Forums/nb-NO/WAVirtualMachinesVirtualNetwork/thread/92a55a09-19c9-4731-b7a6-2b1a9ea909f7