😱 A user turns on their PC and gets hit with this at the sign-in screen:
The trust relationship between this workstation and the primary domain failed.
The classic help desk move is to unjoin the PC from the domain, join it back, and reboot a few times. That works, but it's slow, it needs extra reboots, and it can mess with the user's profile.
There's a faster fix built right into PowerShell. Let's walk through it. 👇
🤔 What's actually broken?
Every domain-joined computer has its own computer account in Active Directory, with a machine password that Windows rotates automatically. If the password on the PC and the one in AD stop matching, the PC can't prove who it is. That is the "secure channel" between the workstation and the domain, and it's now broken.
Usual causes:
- The PC (often a VM) was restored from an old snapshot or image
- Someone reset or reused the computer account in AD
1️⃣ Get signed in
You need to get onto the machine first:
- Disconnect the network (Wi-Fi off or cable out) and sign in with the user's cached credentials, or
- Sign in with a local administrator account.
2️⃣ Test the secure channel
Reconnect to the network (VPN if the user is remote) so the PC can reach a domain controller. Open PowerShell as administrator:
Test-ComputerSecureChannel -Verbose
-
True= the channel is fine, so look elsewhere (DNS, time sync, account lockout). -
False= the machine password is out of sync. Keep going.
3️⃣ Repair it in place 🛠️
Use an account that has rights to reset the computer account:
Test-ComputerSecureChannel -Repair -Credential DOMAIN\adminuser
You'll be prompted for the password. When it returns True, restart the PC and have the user sign in normally. ✅
An alternative that does the same job:
Reset-ComputerMachinePassword -Credential DOMAIN\adminuser
🧯 When to rejoin anyway
If the repair fails (for example, the computer account was deleted from AD), then the unjoin/rejoin route is your fallback. But try the two-minute fix first.
🎯 Recap
- Sign in offline with cached creds or a local admin
- Reconnect and run
Test-ComputerSecureChannel -
False? Run it with-Repair -Credential, then restart
No rejoin, no lost profile, ticket closed. 🙌
What's your go-to fix for trust relationship errors? Have you ever rejoined a PC when a repair would've done it? 👇
Top comments (0)