SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Windows New Added 26 September 2026

The trust relationship between this workstation and the primary domain failed

The machine account password the workstation holds no longer matches the one in Active Directory, so domain logons are refused while local accounts still work. Restoring a virtual machine from a snapshot, cloning without sysprep, or leaving a machine switched off for longer than the password lifetime all produce it, and rejoining the domain is not needed to fix it.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Repair the secure channel in place: no reboot, no rejoin
Test-ComputerSecureChannel -Verbose
Test-ComputerSecureChannel -Repair -Credential (Get-Credential DOMAIN\Admin)

# Or reset the machine account password against a named controller
Reset-ComputerMachinePassword -Server dc01.corp.example.com `
  -Credential (Get-Credential DOMAIN\Admin)

# nltest shows which controller is in use and whether the channel is up
nltest /sc_query:CORP
nltest /dsgetdc:CORP

# Clock skew over five minutes breaks Kerberos and presents the same way
w32tm /query /status
w32tm /resync

# Check the account was not recreated by a rebuild under the same name
Get-ADComputer WS-1234 -Properties PasswordLastSet, whenCreated

How to diagnose Windows errors

Windows errors surface as numeric codes that mean little on their own, but the operating system keeps detailed logs that almost always contain the real cause. Two categories dominate developer machines: missing Visual C++ redistributables (a DLL-not-found error for a runtime the application assumed was present) and architecture or dependency mismatches (the 0xc000007b family, usually a 32-bit/64-bit mix).

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Read Event Viewer under Windows Logs → Application and System, filtered to the time of the failure. The numeric code in the dialog maps to a detailed entry there.
  2. For MSI failures, install with verbose logging: msiexec /i package.msi /l*v install.log, then search the log for "Return value 3". The lines just above name the failing action.
  3. For missing DLLs, install the matching Visual C++ Redistributable and confirm the architecture matches the application (x64 versus x86).
  4. Repair system corruption with sfc /scannow followed by DISM /Online /Cleanup-Image /RestoreHealth, in that order.
  5. For access-denied errors, check both NTFS permissions and whether the process needs elevation; UAC virtualisation can make writes appear to succeed while landing elsewhere.

Tools worth reaching for

  • Event Viewer
  • msiexec /l*v
  • sfc /scannow
  • DISM /RestoreHealth
  • Process Monitor (ProcMon)

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

learn.microsoft.com learn.microsoft.com

Related Windows errors

See all 20 Windows errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.