Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure VM connection error - The user account is currently disabled and cannot be used

Using Azure Powershell create a new VM using my own Vhd based on the tutorial: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-upload-vhd-windows-server/

When try to connect to the VM it pops the error:

The user account is currently disabled and cannot be used.

Below is the scripts for creating the VM

#create the vm using the image
$image = Get-AzureVMImage $MyImage
$vmname = "Test-Machine"
$vmsize = "Large"
$vm1=New-AzureVMConfig -Name $vmname -InstanceSize $vmsize -ImageName $image.imageName
$vm1 | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password
New-AzureVM –ServiceName $myServiceName -VMs $vm1
like image 800
Peter Avatar asked Oct 22 '25 06:10

Peter


1 Answers

I just ran into this issue as well, trying to login a fresh Azure Windows 10 virtual machine.

You can fix this issue by:

  1. On the virtual machine page, head over to Run command
  2. Click on EnableAdminAccount
  3. Run the cmdlet

You should see something like:

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

You should now be able to login in the virtual machine successfully.

like image 84
Paolo Avatar answered Oct 24 '25 21:10

Paolo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!