我在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.
无法理解问题是什么/如何进行故障排除以及如何解决。
答案 0 :(得分:1)
我尚未按terraform设置VM。相反,我在Azure门户上手动部署了两个Azure VM(一个作为AD和DNS服务器,另一个作为客户端)。步骤很简单,如下所示:
contoso.com
。通常,同一子网中的VM可以相互通信,而没有任何端口限制。因此,这看起来像DNS方面的问题。您可以重新启动VM或在客户端VM上ipconfig/flushdns
。或验证DNS records是否在DC VM上正确创建。
此外,您可以参考此事件error code 1355和本故障排除教程:How to troubleshoot errors that occur when you join Windows-based computers to a domain