无法将 VM 加入 AD - 无法完成此功能
Unable to join VM to AD - cannot complete this function
我在 Azure 中有一个 VM,在 Azure 中也有一个 AD VM。它们都在同一个网络中,尽管在不同的子网中。
我已经通过 terraform 配置了 VM,但它们无法加入 AD,因此我正在手动操作以查看错误是什么。
将 VM 连接到 AD 的命令如下:
PS C:\Users\scmadmin> $domain = "contoso.com"
PS C:\Users\scmadmin> $password = "<password here>" | ConvertTo-SecureString -asPlainText -Force
PS C:\Users\scmadmin> $username = "$domain\scmadmin"
PS C:\Users\scmadmin> $credential = New-Object System.Management.Automation.PSCredential($username,$password)
PS C:\Users\scmadmin> Add-Computer -DomainName $domain -Credential $credential
执行后的日志输出如下:
Add-Computer : Computer 'erxprebussvc01' failed to join domain 'contoso.com' from its current workgroup 'WORKGROUP'
with following error message: Cannot complete this function.
At line:1 char:1
+ Add-Computer -DomainName $domain -Credential $credential
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (erxprebussvc01:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : FailToJoinDomainFromWorkgroup,Microsoft.PowerShell.Commands.AddComputerCommand
在虚拟网络级别,DNS 服务器 IP 是 AD=10.112.1.4 的 IP(私有 IP)
我可以 ping 域,
PS C:\Users\scmadmin> ping contoso.com
Pinging contoso.com [10.112.1.4] with 32 bytes of data:
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Ping statistics for 10.112.1.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
Windows 事件查看器日志报告以下错误
The machine erxprebussvc01 attempted to join the domain contoso.com but failed. The error code was 1355.
无法理解什么是 issue/how 需要解决的问题以及如何解决它。
我还没有通过 Terraform 配置虚拟机。相反,我在 Azure 门户上手动部署了两个 Azure VM(一个作为 AD 和 DNS 服务器,另一个作为客户端)。步骤简单如下:
- 将两个 VM 部署在不同的子网但在同一个 VNet 中。
- 在AD服务器上设置服务器角色(ADDC、DNS),使其成为DC服务器。
- 将 DNS 服务器更改为 Azure VNet 门户中的 AD 专用 IP 地址。
- 在 Azure 门户上重新启动两个 Azure VM。
- VM 恢复 运行 后,RDP 到客户端 VM,您可以手动或通过命令将此 VM 加入 AD 域
contoso.com
。
一般情况下,同一子网中的虚拟机可以相互通信,没有任何端口限制。所以它看起来像你这边的 DNS 问题。您可以在客户端 VM 上重新启动 VM 或 ipconfig/flushdns
。或者验证 DNS records 是否在 DC VM 上正确创建。
另外,你可以参考这个活动error code 1355 and this troubleshooting tutorial: How to troubleshoot errors that occur when you join Windows-based computers to a domain
我在 Azure 中有一个 VM,在 Azure 中也有一个 AD VM。它们都在同一个网络中,尽管在不同的子网中。
我已经通过 terraform 配置了 VM,但它们无法加入 AD,因此我正在手动操作以查看错误是什么。
将 VM 连接到 AD 的命令如下:
PS C:\Users\scmadmin> $domain = "contoso.com"
PS C:\Users\scmadmin> $password = "<password here>" | ConvertTo-SecureString -asPlainText -Force
PS C:\Users\scmadmin> $username = "$domain\scmadmin"
PS C:\Users\scmadmin> $credential = New-Object System.Management.Automation.PSCredential($username,$password)
PS C:\Users\scmadmin> Add-Computer -DomainName $domain -Credential $credential
执行后的日志输出如下:
Add-Computer : Computer 'erxprebussvc01' failed to join domain 'contoso.com' from its current workgroup 'WORKGROUP'
with following error message: Cannot complete this function.
At line:1 char:1
+ Add-Computer -DomainName $domain -Credential $credential
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (erxprebussvc01:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : FailToJoinDomainFromWorkgroup,Microsoft.PowerShell.Commands.AddComputerCommand
在虚拟网络级别,DNS 服务器 IP 是 AD=10.112.1.4 的 IP(私有 IP)
我可以 ping 域,
PS C:\Users\scmadmin> ping contoso.com
Pinging contoso.com [10.112.1.4] with 32 bytes of data:
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Reply from 10.112.1.4: bytes=32 time=1ms TTL=128
Ping statistics for 10.112.1.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
Windows 事件查看器日志报告以下错误
The machine erxprebussvc01 attempted to join the domain contoso.com but failed. The error code was 1355.
无法理解什么是 issue/how 需要解决的问题以及如何解决它。
我还没有通过 Terraform 配置虚拟机。相反,我在 Azure 门户上手动部署了两个 Azure VM(一个作为 AD 和 DNS 服务器,另一个作为客户端)。步骤简单如下:
- 将两个 VM 部署在不同的子网但在同一个 VNet 中。
- 在AD服务器上设置服务器角色(ADDC、DNS),使其成为DC服务器。
- 将 DNS 服务器更改为 Azure VNet 门户中的 AD 专用 IP 地址。
- 在 Azure 门户上重新启动两个 Azure VM。
- VM 恢复 运行 后,RDP 到客户端 VM,您可以手动或通过命令将此 VM 加入 AD 域
contoso.com
。
一般情况下,同一子网中的虚拟机可以相互通信,没有任何端口限制。所以它看起来像你这边的 DNS 问题。您可以在客户端 VM 上重新启动 VM 或 ipconfig/flushdns
。或者验证 DNS records 是否在 DC VM 上正确创建。
另外,你可以参考这个活动error code 1355 and this troubleshooting tutorial: How to troubleshoot errors that occur when you join Windows-based computers to a domain