We\'re using an azure vm as a domain controller and for some reason the local administrator\'s pw has expired. When trying to reset the pw I get the following error message: \"V
For a DC, the reset is not supported using the normal VM Reset Password option. Instead, use a custom script:
Open a new notepad window.
Write: net user [Username] [Password]
Without the brackets and replacing the default values with your own.
Save it as script.ps1
Navigate to the VM in the Azure Portal
On the left menu under Settings > select Extensions > select Add+
Select Custom Script Extension option from the list
Select Create
Upload the script.ps1 file
Select Ok
MSFT Support let me know that it's not possible to log into an Azure VM that is a domain controller VM with the user that is created in the Azure portal when configuring the VM. You can only log in using one of the domain users.
MS now have this covered with PowerShell access for owners/admin.
Navigate to the VM in the Azure Portal.
On the left menu:
2a. enter "run" into the search textbox and press enter, then click on 'Run Command'
OR
2b. navigate to Operations > Run command
Click on EnableAdminAccount then click Run. Use the X in the top right to close the window, and wait for the notification when the script finishes. Select EnableAdminAccount again to see progress if necessary.
If step 3 succeeds, cick on "RunPowerShellScript".
In line numbered 1 enter "net user [Username] [Password]", then click Run. The [username] here is the RDP user to login with local owner/admin rights.
Job done. You should now be able to RDC to your server using the local admin [username] as the login name (ie. \username).