Eintrag

Azure VM – Passwort vergessen

Aus

http://blogs.technet.com/b/keithmayer/archive/2014/04/03/microsoft-azure-virtual-machines-reset-forgotten-admin-password-with-windows-powershell.aspx

Einfach den Built-In-Admin resetten (ACHTUNG: unbedingt aktuelle Azre Powershell holen, bei 0.7.3 war ein Käfer …)

Add-AzureAccount

Get-AzureSubscription Format-Table Property SubscriptionName

$subscription = ENTER YOUR SUBSCRIPTION NAME HERE

Select-AzureSubscription Default $subscription

$adminCredentials = Get-Credential -Message „Enter new Admin credentials“

(Get-AzureVM) |
Where-Object -Property Status -EQ „ReadyRole“ |
Select-Object -Property Name, ServiceName |
Out-GridView -Title „Select a VM “ -PassThru |
ForEach-Object {
$VM = Get-AzureVM -Name $_.Name -ServiceName $_.ServiceName
If ($VM.VM.ProvisionGuestAgent) {
Set-AzureVMAccessExtension -VM $VM `
-UserName $adminCredentials.UserName `
-Password $adminCredentials.GetNetworkCredential().Password `
-ReferenceName „VMAccessAgent“ |
Update-AzureVM
Restart-AzureVM -ServiceName $VM.ServiceName -Name $VM.Name
} else {
Write-Output „$($VM.Name): VM Agent Not Installed“
}
}

Dieser Eintrag ist vom Autor unter CC BY 4.0 lizensiert.