Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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" | 
        Restart-AzureVM -ServiceName $virtualMachine.ServiceName -Name $virtualMachine.Name
    } else {
        Write-Output "$($virtualMachine.Name): VM Agent Not Installed"
share|improve this answer
It will work only if provision agent is installed. If you do not have provision agent installed you are screwed. –  Mahin Jul 6 '14 at 13:35
I got problems with the Select-AzureSubscription and followed this advice to store my credentials: stackoverflow.com/questions/22817539/… For those how are unsure what the variables should look like: Just issue Get-AzureVM and a listing of all VMs is shown –  zeeman Jan 16 at 17:15

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.