← Back to knowledge base
Windows ServerFor IT admins

Fix "The trust relationship between this workstation and the primary domain failed"

A domain PC refuses domain sign-ins because its computer account password is out of sync. Repair the secure channel without rejoining the domain.

Last verified October 3, 2026

Every domain computer has its own account and password, changed automatically every 30 days by default. If the PC and the domain disagree on that password, domain users can’t sign in.

Symptoms

  • At sign-in: “The trust relationship between this workstation and the primary domain failed.”
  • Netlogon events such as 5719 or 5805.
  • The PC was restored from a snapshot or image, or was off the network for a long time.

Cause

  • The PC was rolled back to a snapshot, restore point or image taken before its last password change.
  • Two PCs share the same name, or the computer account was reset or deleted in AD.
  • Replication problems mean DCs disagree about the account.

Fix

1. Sign in locally

Sign in with a local administrator account (.\Administrator or COMPUTERNAME\localadmin). Your organization’s LAPS password works here, if you use LAPS. Cached domain credentials may also work while disconnected from the network.

2. Test and repair the secure channel

Connect the PC to the network, then in Windows PowerShell 5.1 as administrator:

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

Enter a domain account allowed to reset computer accounts. A result of True means it’s fixed. Restart and sign in with a domain account.

3. Alternative from the command line

netdom resetpwd /server:<dc-name> /userd:DOMAIN\admin /passwordd:*

Restart afterwards.

If that didn’t work

  • Check that the PC can reach a DC and resolve its name. See Troubleshoot DNS for Active Directory.
  • Check that the computer account still exists and is enabled in Active Directory Users and Computers.
  • As a last resort, move the PC to a workgroup, restart, and rejoin the domain. Domain users keep their existing profiles, because their account SIDs don’t change.

When to call us

Sources

Didn’t fix it? We can take a look.

Open a ticket