我已啟用 winrm、停用防火牆、啟用遠端處理、winrm 的 GPO、啟用 SMBv1 並首先完成更新作為故障排除,但我仍然收到錯誤。我也能 ping 通 DC。
我得到的錯誤是:
Add-Computer: Computer "server2019' failed to join domain 'dev.domain.com' from its current workgroup 'WORKGROUP' with following error message: An internal error occurred.
At line:1 char:1
Add-Computer -DomainName dev.domain.com -OUPath "OU=$OU,dc=dev,dc=domain,dc=com" ...
CategorvInfo :Operation5topped: (server2019:5tring) [Add-Computer]
. InvalidoperationException
+ FullvOualifiedErrorId:FailToJoinDomainFromworkgroup,Microsoft.PowerShell.Commands.AddComputerCommand
這是我的腳本中執行連接的部分:
[String]$OU,
[PSCredential]$Credential
)
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
if ([Environment]::UserInteractive) {
if (!$OU) { $OU = Read-Host "Enter Resource Pool Name (exactly as appears in vCenter inventory)" }
if (!$Credential) { $Credential = Get-Credential -Message "Enter dev domain credentials" }
}
# Add Computer to Dev domain
try {
Add-Computer -DomainName dev.domain.com -OUPath "OU=$OU,dc=dev,dc=domain,dc=com" -ErrorAction stop -Credential $Credential
}
catch {
Write-Warning "Failed to join to domain."
Read-Host -Prompt "Press Enter to exit"
Throw $_
}
PS C:\Windows\ system32> nltest.exe/dsgetdc:dev.domain.com
DC: \\devad02.dev.domain.com
Address: \\10.1.214.29
Do Guid: ae3bef55-dd18-4598-b809-2058516e6abl
Dom Name: dev.domain.com
Forest Name: dev.domain.com
De Site Name: SITE
Our Site Name: SITE
Flags: GC DS LDAP KDC TIMESERV WRITABLE DNS_DC DNS_DOMAIN DNS_FOREST CLOSE_SITE FULL_SECRE
TWS D5_8 D5_9 D5_10 0x20000
The command completed successfully
編輯:伺服器管理員顯示 NetJoin 的錯誤事件,給出錯誤代碼 1359 我嘗試運行:
nltest /dclist:MYDOMAIN
並得到:
You don't have access to DsBind to dev.domain.com
我還嘗試運行:nltest /server:UserSyncServer /sc_reset:domain\devdc
並得到:I_NetLogonControl failed: Status = 1722 0x6ba RPC_S_SERVER_UNAVAILABLE
答案1
Microsoft 建議將網域控制站上的 MsDS-SupportedEncryptionTypes 從 RC4 變更為 AES,但對我有用的是刪除並重新新增 DC 之間的傳出和前向傳遞信任。
答案2
這個解決方案對我有用。停用 DC 暫存器中的 AllwNt4Crypto https://learn.microsoft.com/es-mx/services-hub/health/remediation-steps-ad/disable-the-allownt4crypto-setting-on-all-affected-domain-controllers