Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kevin-Bronsdijk/5696cd236f042fc5acd9 to your computer and use it in GitHub Desktop.
Save Kevin-Bronsdijk/5696cd236f042fc5acd9 to your computer and use it in GitHub Desktop.
azure-virtual-machine-reset-the-username
$vmc = Get-AzureVM -ServiceName $serviceName -Name $vmName
$vmc.VM.ProvisionGuestAgent
$vmName = "name of the VM"
$serviceName = "name of the sercvice"
$newAdminUserName = "name of the user"
$newAdminPassword = "the password"
$vmc = Get-AzureVM -ServiceName $serviceName -Name $vmName
$vmc | Set-AzureVMAccessExtension -UserName $newAdminUserName -Password $newAdminPassword
$vmc | Update-AzureVM
Restart-AzureVM -ServiceName $serviceName -Name $vmName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment