Hello Leotrim Ramadani
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
You can change the administrative username and password for a Windows Azure Virtual Machine by using the VMAccess extension. You can use the Set-AzVMAccessExtension command in PowerShell to reset the administrative password of a Windows VM to a temporary password. Sample commands below for your reference. After you run this code, you should reset the password at first login.
$cred=Get-Credential
Set-AzVMAccessExtension -ResourceGroupName "myResourceGroup" -VMName "myVM" -Name "myVMAccess" -Location WestUS -UserName $cred.GetNetworkCredential().Username -Password $cred.GetNetworkCredential().Password -typeHandlerVersion "2.0"
If you don't have VMAccess extension on your VM, you can add it through Azure Portal.
Select the VM in the portal, select Extensions, and then select Add. Choose the VMAccess extension from the list of available extensions, and follow the instructions in the wizard.
Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/features-windows
From Azure Portal, you can try a reset of password:
- Go to the Azure portal and navigate to your Virtual Machine.
- Click on the "Extensions" button in the left-hand menu.
- Click on the "Add" button and then select "VM Access" from the list of available extensions.
- In the "VM Access" blade, select the appropriate subscription and resource group, and then select the Virtual Machine for which you want to reset the password.
- Enter a new username and password for the admin account, and then click on the "Ok" button.
- Once the extension is installed, connect to the Virtual Machine using RDP and enter the new admin username and password.
Hope this helps.
If you need further help on this, tag me in a comment.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.