Hello @Mohamed Sulthan
If you are trying to login a new Azure Windows VM, try following steps:
- On the virtual machine page, head over to Run command
- Click on EnableAdminAccount
- Run the cmdlet
Admin account was disabled. Enabling the Admin account.
Path : \\localhost\root\cimv2:Win32_UserAccount.Domain="PaoloWin10",Name="PaoloUser"
RelativePath : Win32_UserAccount.Domain="PaoloWin10",Name="PaoloUser"
Server : localhost
NamespacePath : root\cimv2
ClassName : Win32_UserAccount
IsClass : False
IsInstance : True
IsSingleton : False
If the VM was uploaded from on premise source, you would need to add a SetupComplete2.cmd
and EnableLocalAdminAccount.ps1
in C:/Windows/OEM
to unlock the user account automatically upon VM creation. Strangely enough this does not appear on anywhere on Microsoft's guideline on how to migrate a on-prem VM to Azure, but the official windows image from the Marketplace do have those 2 files that are run after Sysprep.
This blog article was also very useful and points towards the creation of a SetupComplete2.cmd https://matt.kotsenas.com/posts/azure-setupcomplete2
Additional information
https://stackoverflow.com/questions/66584398/azure-new-vm-account-disabled-by-default-custom-image
https://stackoverflow.com/questions/19951814/azure-unable-to-connect-to-rdp