how do i edit administrator username ?

ODL_User 1465176 0 Reputation points
2024-10-29T22:32:52.8566667+00:00

i need to change administrator username. how can I edit administrator username of a virtual machine i already created. someone please help.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,040 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 11,055 Reputation points Volunteer Moderator
    2024-10-29T23:35:58.5833333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    If you absolutely need to change the original administrator username, you'll need to redeploy the VM.

    While this method doesn't change the original username, it allows you to set up a new administrator account:

    Set-AzVMAccessExtension -ResourceGroupName "myResourceGroup" -VMName "myVM" -Name "myVMAccess" -Location "WestUS" -UserName "newAdminUsername" -Password "newPassword" -typeHandlerVersion "2.0"
    
    

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.