gpt4 book ai didi

powershell - Azure VM 连接错误 - 用户帐户当前已禁用且无法使用

转载 作者:行者123 更新时间:2023-12-02 22:40:24 27 4
gpt4 key购买 nike

使用 Azure Powershell 根据教程使用我自己的 Vhd 创建一个新 VM: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-upload-vhd-windows-server/

当尝试连接到虚拟机时,会弹出错误:

The user account is currently disabled and cannot be used.

下面是创建虚拟机的脚本

#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

最佳答案

我刚刚也遇到了这个问题,尝试登录新的 Azure Windows 10 虚拟机。

您可以通过以下方式解决此问题:

  1. 在虚拟机页面上,转到运行命令
  2. 点击启用管理员帐户
  3. 运行 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

您现在应该能够成功登录虚拟机。

关于powershell - Azure VM 连接错误 - 用户帐户当前已禁用且无法使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35022035/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com