Azure vm connection error through RDP

Mohamed Sulthan 0 Reputation points
2023-10-31T00:46:18.64+00:00

while connecting vm through rdp it is showing this error: the user account is currently disabled and cannot be used. And error cdoe:0xb07, extended error code: 0x0. How to fix this?
User's image

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,158 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,367 questions
Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,251 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
348 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 10,976 Reputation points MVP
    2023-10-31T21:19:15.66+00:00

    Hello @Mohamed Sulthan

    If you are trying to login a new Azure Windows VM, try following steps:

    1. On the virtual machine page, head over to Run command
    2. Click on EnableAdminAccount
    3. 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

    1 person found this answer helpful.
    0 comments No comments