Azure VM – Passwort vergessen
Aus
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“
}
}