Printable checklist

How to Fix "The Trust Relationship Between This Workstation and the Primary Domain Failed"

The trust relationship between this workstation and the primary domain failed means the machine password no longer matches Active Directory. That secret rotates every 30 days, so an offline laptop drifts out of sync. Repair the channel before you rejoin.

By 52runoob Editorial Team · 19 steps · Accounts & Online Services · Updated December 4, 2026

Back to the guide
  1. 1. Log In With a Local Administrator

    Type `.\LocalAdmin` or `<MachineName>\LocalAdmin` at the logon screen. That forces a local logon, not a domain one. Repair never works from the broken domain account. More on this: [Microsoft Learn — Active Directory Replication…

  2. 2. Check the Clock Before Anything Else

    Run `w32tm /query /status` and compare the time with your phone. Kerberos rejects requests once the skew passes 5 minutes, and a dead CMOS battery on an old desktop causes exactly this. A correct clock can fix it alone. Official reference…

  3. 3. Test the Secure Channel

    In an elevated PowerShell window run `Test-ComputerSecureChannel`. `True` means the channel is fine and the fault sits elsewhere. `False` means the machine password is out of sync, and that secret rotates every 30 days by default. Source:…

  4. 4. Confirm the Domain Name

    Run `systeminfo | findstr /i domain` or `echo %USERDOMAIN%` and write the exact name down. A typo in the domain name during the repair fails with a misleading error about credentials rather than about the domain itself. Write it down…

  5. 5. Check Whether the Machine Account Exists

    Ask IT to look for your computer name under the default Computers container. If the object was deleted, every local repair command will fail and a rejoin is the only route left. Ask before you repair. Reference — [Microsoft Learn — Entra…

  6. 6. Find a Domain Controller With nltest

    Run `nltest /dsgetdc:contoso.com` with your real domain name. You want a DC name and an address back. If it fails, you are not on the corporate network, and no local command will work until you are. → [Microsoft Learn —…

  7. 7. Run the Repair Switch

    Run `Test-ComputerSecureChannel -Repair -Credential (Get-Credential)` and enter an account that can reset computer objects. The cmdlet writes a new machine password and re-creates the channel. It prints `True` when the repair landed. More…

  8. 8. Handle the Credential Failure

    If it returns `False` or throws an access error, the account you typed cannot write to the computer object. That is permissions, not a broken command. Ask for an account with delegated rights, or let IT run this step on your behalf.…

  9. 9. Reset the Password Directly

    Run `Reset-ComputerMachinePassword -Server DC01 -Credential (Get-Credential)` with a real controller name. Unlike the repair switch, it resets the password without testing the channel first. Use it when the test itself errors out. Source:…

  10. 10. Fall Back to Netdom

    Run `netdom resetpwd /Server:DC01 /UserD:CONTOSO\admin /PasswordD:*`. Netdom is the legacy tool: it needs both a user and a password argument, and it ships with RSAT only. The asterisk keeps the password out of your history. Worth…

  11. 11. Restart Before You Test Again

    Reboot the machine. The new machine password is written to the local secrets store at shutdown, and some cached tickets still hold the old one. Testing before that restart gives you a false `False` and wasted time. Reference — [Microsoft…

  12. 12. Test With a Network Resource

    After the restart, open `\\dc01\netlogon` or any share you have rights to. A credential prompt means the channel is up. Silent access denied means move to the rejoin. → [Microsoft Learn — Active Directory Replication…

  13. 13. Resync the Time Service

    Run `w32tm /resync /force`. If the trust fails again within an hour, clock drift is the usual cause. Point the machine at the domain hierarchy with `w32tm /config /syncfromflags:domhier /update` to end the pattern. More on this:…

  14. 14. Save the Profile Path First

    Before you leave the domain, note `C:\Users\<name>` and copy anything irreplaceable to a share. Rejoining produces a new local profile in many cases, and the old folder stays orphaned under a modified name. That surprises people. Official…

  15. 15. Leave the Domain

    Open `System Properties → Computer Name → Change` and switch to Workgroup, or use `Settings → Accounts → Access work or school`. Pick a workgroup name that is not already used on the network. Reboot when prompted. Source: [Microsoft Learn…

  16. 16. Delete the Stale Computer Object

    Ask IT to remove the old computer account from AD before you rejoin, or you inherit the same broken object. This single step is why rejoining sometimes fixes nothing. Confirm the deletion first. Worth reading: [Microsoft Learn — Entra…

  17. 17. Rejoin With Domain Credentials

    Return to `System Properties → Computer Name → Change`, choose Domain, and enter the name plus an account allowed to join computers. A message about the join failing here usually means the name is taken or the rights are missing. Expect…

  18. 18. Reattach the Old Profile Folder

    Sign in, then copy the old folder contents into the new profile and take ownership with `icacls`. Domain profiles are keyed to the account SID, and a rejoin can hand you a new one, so expect to redo shortcuts and mail settings. Expect to…

  19. 19. Stop Before You Rejoin Blindly

    Stop if IT has not confirmed the machine account was deleted, if you cannot log in locally, or if the disk is BitLocker-encrypted and you have no recovery key. Rejoining a machine you cannot log into is how a fixable PC becomes a reimage.…