"The trust relationship between this workstation and the primary domain failed"
The machine account password no longer matches what the domain holds, so the secure channel cannot be established.
What you see
Domain sign-in fails at the workstation with this message. A local administrator can still sign in. Very common after restoring a machine from a snapshot or an image.
What is actually wrong
The machine changes its own account password every 30 days. Restoring to a snapshot older than that leaves the machine holding a password the domain has since replaced. A duplicate computer object or a machine that has been off for months does the same.
Codes and articles
Fixes (2)
Repair the secure channel without leaving the domain
Always try this before the remove-and-rejoin that everyone reaches for.
Sign in with a local administrator account. A cached domain account may work; a fresh one will not.
Confirm the channel is actually broken.
Test-ComputerSecureChannel -VerboseRepair it, supplying domain credentials with permission to reset the computer object.
Test-ComputerSecureChannel -Repair -Credential (Get-Credential DOMAIN\admin)This resets the machine account password on both sides in place. Removing the machine from the domain and rejoining does the same thing but destroys the computer object's group memberships, its BitLocker escrow and any Group Policy that targets it — which is why it is the wrong first move.
If that fails, reset the password with the netdom equivalent.
Reset-ComputerMachinePassword -Server DC01 -Credential (Get-Credential DOMAIN\admin)Restart and sign in with a domain account.
Test-ComputerSecureChannelRule out the causes that look identical
The repair failed, or nothing explains why it broke.
Check for a duplicate computer object in the directory — two objects with the same name is a common cause after a rebuild.
Get-ADComputer -Filter { Name -like 'LAPTOP01*' } -Properties whenCreated,PasswordLastSet | Format-Table Name,DistinguishedName,whenCreated,PasswordLastSetCheck the machine can reach a domain controller at all — a DNS fault produces the same message.
nltest /dsgetdc:yourdomain.localResolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.yourdomain.local
"Trust relationship failed" is also what Windows says when it cannot find a domain controller to ask. Confirming the machine can locate one separates a broken account from a broken network in one command.
Check the time. More than five minutes of skew breaks Kerberos and presents identically.
w32tm /query /statusw32tm /stripchart /computer:DC01 /samples:3 /dataonly
Only if the object is genuinely wrong, reset it in the directory and repair from the client.
Get-ADComputer LAPTOP01 | Reset-ComputerMachinePassword -ErrorAction SilentlyContinuedsmod computer 'CN=LAPTOP01,OU=Computers,DC=yourdomain,DC=local' -reset
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.