Skip to main content
AD Academy
Back to all recipes
Level: JuniorLast updated:

Fix "the trust relationship with the domain failed"

Test-ComputerSecureChannel -Verbose
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

Why it works this way

No need to leave and rejoin — one command refreshes the machine account password.

Caution

Do not rejoin the domain as a first step — it creates a new object with a new SID and loses permissions and history.

Watch out

  • Run it on the machine itself with a local admin.
  • Recurring? Likely an old snapshot restore or a duplicate name.

Related events