Json Set-AzureRmVMADDomainExtension无法将VM添加到AD域

Json Set-AzureRmVMADDomainExtension无法将VM添加到AD域,json,azure,Json,Azure,以下VM扩展无法将VM添加到域 当广告中存在“计算机帐户”时,它可以正常工作。如果“计算机帐户”不存在(新服务器),它将失败 设置AzureRmVMADDomainExtension-TypeHandlerVersion“1.0”-JoinOption 3-域名$strDomainName-资源组名$stres_GrpName-VMName$strHostName-凭证$objCred-输出路径$strServerOU-重新启动 加入选项3应完成以下操作。 价值意义 NETSETUP\u加入\u

以下VM扩展无法将VM添加到域

当广告中存在“计算机帐户”时,它可以正常工作。如果“计算机帐户”不存在(新服务器),它将失败

设置AzureRmVMADDomainExtension-TypeHandlerVersion“1.0”-JoinOption 3-域名$strDomainName-资源组名$stres_GrpName-VMName$strHostName-凭证$objCred-输出路径$strServerOU-重新启动

加入选项3应完成以下操作。

价值意义 NETSETUP\u加入\u域 0x00000001将计算机加入域。如果未指定此值,则将计算机加入工作组。 网络设置帐户创建 0x00000002在域上创建帐户

在Azure VM扩展下找到以下错误详细信息:

[


]

只有内置的“计算机”OU有问题。 同时尝试了“OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk”和“CN=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk”。由于相同的错误而失败

但其他用户创建的OU运行良好。例如,“OU=TSTVLAN,OU=MGTServers,,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk”

由于日志中的错误1323“指定用户而不使用NetSetupAcctCreate”,我的操作失败。 我需要更新用户名以包含域,即 用户='domainName\userName' 然后它成功了

{
    "code": "ComponentStatus/JoinDomainException for Option 3 meaning 'User Specified'/failed/1",
    "displayStatus": "Provisioning failed",
    "level": "Error",
    "message": "ERROR - Failed to join domain='MyAd.ad.company.co.uk', ou='OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk', user='LocalAdmin@MyAD.ad.company.co.uk', option='NetSetupJoinDomain, NetSetupAcctCreate' (#3 meaning 'User Specified'). Error code 2",
    "time": null
}

{
    "code": "ComponentStatus/JoinDomainException for Option 1 meaning 'User Specified without NetSetupAcctCreate'/failed/1",
    "displayStatus": "Provisioning failed",
    "level": "Error",
    "message": "ERROR - Failed to join domain='MyAd.ad.company.co.uk', ou='OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk', user='MGTAdmin@MyAd.ad.company.co.uk', option='NetSetupJoinDomain' (#1 meaning 'User Specified without NetSetupAcctCreate'). Error code 1332",
    "time": null
}