trust relationship failed 🪟 Windows

The trust relationship between this workstation and the primary domain failed

The computer’s machine account password no longer matches Active Directory, so domain logins fail.

Seen on: Windows

Meaning

Restoring a VM snapshot/old image, a duplicate computer name, or the PC being offline for a very long time makes the secure channel break. Rejoining or resetting the secure channel fixes it.

Common causes

  • VM restored from an old snapshot
  • Computer account reset or deleted in AD
  • Duplicate computer name / cloned image without sysprep
  • Very long time offline

⚡ Quick fix

  1. Log in with a local admin and reset the secure channel
  2. Or rejoin the domain
  3. Avoid restoring old snapshots of domain members

Detailed fix by platform

PowerShell

  1. powershell
    Test-ComputerSecureChannel -Repair -Credential (Get-Credential DOMAIN\admin)
    # or
    Reset-ComputerMachinePassword -Credential (Get-Credential DOMAIN\admin)

How to diagnose

  1. AD — Computer object exists/enabled?
  2. Snapshot — Restored recently?
  3. Name — Duplicates?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.