The error message "The trust relationship between this workstation and the primary domain failed" typically indicates that the secure channel between a domain-joined computer and the domain controller has been disrupted. This issue can occur when the machine's password is not synchronized with the domain database or if the computer account in the domain has been deleted or corrupted.
To resolve this issue, you can follow these steps using either Command Prompt or PowerShell:
Command Prompt
- Sign in with the local administrator account.
- Open an elevated command prompt window.
- Test the secure channel with the command:
netdom verify ComputerName /domain:YourDomainName - Reset the machine password:
netdom resetpwd /server:DomainControllerName /userd:Domain\Username /passwordd:* - Reset the secure channel:
netdom reset /domain:YourDomainName /userd:DomainUsername /passwordd:* - Restart your device.
PowerShell
- Sign in with the local administrator account.
- Open an elevated PowerShell window.
- Test the secure channel:
Test-ComputerSecureChannel - If the test returns
False, repair the secure channel:Test-ComputerSecureChannel -Repair -Credential (Get-Credential) - Reset the computer account password:
$credential = Get-Credential Reset-ComputerMachinePassword -Credential $credential Restart-Computer -Force - After rebooting, follow the steps to rejoin the domain if necessary.