使用自定义 Windows 映像在 Microsoft Azure 中创建 VM 时遇到问题。
问题
使用在 Azure 门户中输入的凭据连接到新生成的 VM 时,我收到以下消息:
The user account is currently disabled and cannot be used.
使用 Azure 门户的“运行命令”菜单运行Get-LocalAccount
脚本,我得到以下输出:
Name Enabled Description
---- ------- -----------
DefaultAccount False A user account managed by the system.
Guest False Built-in account for guest access to the computer/domain
myusername False Built-in account for administering the computer/domain
WDAGUtilityAccount False A user account managed and used by the system for Windows Defender Application
解决方法
如果我使用Azure VM 连接错误的过程 - 用户帐户当前已禁用且无法使用,我可以解锁用户并通过 RDP 连接到 VM。
我还尝试在系统准备 VM 之前创建一个新用户,以便在创建 VM 期间由 Azure 重命名和禁用本地管理员帐户,但创建的用户帐户保持启用状态。
图片信息
操作系统:Windows 10 LTSC 2019
来源:我公司使用的自定义部署映像。它与 ISO 一起安装在本地 HyperV 机器上,从托管磁盘上传到 Azure 和 SysPrep。
在运行 sysprep 之前,在 VM 上安装了 WindowsAzureVmAgent 版本 2.7.41491.949_191001-1418。
采取的步骤
- 重新启用帐户并再次运行 Sysprep 以创建新快照并不能解决问题
- 在 Sysprep 设备之前重命名本地管理员帐户没有任何效果。
- 检查了当地的政策,没有什么不寻常的。