Flamingo Raises $4.5M Seed Round

Skip to content

The trust relationship between this workstation and the primary domain failed: fix it without rejoining

IT Operations
Troubleshooting
Aliaska VarievaAliaska Varieva
September 29, 2026
604 views
The trust relationship between this workstation and the primary domain failed: fix it without rejoining

How to fix "the trust relationship between this workstation and the primary domain failed" with one PowerShell command or netdom instead of rejoining the domain, how to tell which side has the stale password, the September 2026 Windows update that broke trust on some devices, and how to stop it across a fleet.


Updated: November 2026

"The trust relationship between this workstation and the primary domain failed" means the computer's copy of its machine account password no longer matches the copy in Active Directory, so domain logons stop working. The fix is one line in an elevated Windows PowerShell, Test-ComputerSecureChannel -Repair -Credential DOMAIN\admin, then a restart, with no need to rejoin the domain. This guide covers that fix and its fallbacks, how to tell which side is wrong, the September 2026 Windows update that caused the same error, and how to stop it across a fleet.

What the error means

Every domain-joined computer has its own account in Active Directory, with its own password. The computer keeps a copy of that password, and Active Directory keeps another. When the two copies match, the computer and the domain controller build a secure channel and domain logons work.

When the copies stop matching, the secure channel breaks. Domain logons fail with this error, but a local account or cached credentials still get you in. That detail matters, because it's how you get to a prompt to fix it.

The computer changes its own password every 30 days by default, per Microsoft's policy reference. Anything that rolls one side back to an older password breaks the match. The System log usually shows it as NETLOGON event 3210.

Fix it without rejoining the domain

Sign in with a local admin account, or with cached domain credentials if the machine still accepts them. Open Windows PowerShell as administrator and run:

powershell
Test-ComputerSecureChannel -Repair -Credential DOMAIN\admin

Then restart. The cmdlet removes and rebuilds the secure channel through the Netlogon service, and it returns True when the channel works. You need local admin rights to run it, domain credentials that can reset the computer account, and a line of sight to a domain controller.

Two other commands do the same job when that one fails:

powershell
Reset-ComputerMachinePassword -Server DC01 -Credential DOMAIN\admin
console
nltest /sc_reset:yourdomain.local

Reset-ComputerMachinePassword sets a fresh password against the domain controller you name, which helps when one DC is misbehaving. nltest is the same repair from a plain command prompt. Both cmdlets live in Windows PowerShell 5.1, not PowerShell 7, so use the built-in shell. Our PowerShell commands guide covers the rest of the toolkit.

netdom reset does the same repair for a computer you name. It comes with the AD DS role or the AD DS tools in RSAT, and it needs an elevated prompt:

console
netdom reset PC01 /domain:yourdomain.local

Don't confuse it with netdom resetpwd, which resets a domain controller's own machine account password and must run on that DC. On domain controllers, Test-ComputerSecureChannel returns false positives, so check them with nltest or netdom.

Rejoining still works as a last resort. Microsoft's own troubleshooting article calls it valid, then points out it won't tell you why the trust broke. If the same machine breaks again next month, you'll want the why.

Danny Moran runs the PowerShell repair on a live machine in under four minutes.

Check which side is wrong first

The mismatch has two possible directions, and Microsoft treats them as separate problems. Either the computer holds the newer password and Active Directory holds an old one, or the other way round.

Start on the device. In the System log, NETLOGON event 5823 marks each successful machine password change, so the newest one shows when the device last changed it. The same date sits in the CupdTime value under HKLM\SECURITY\Policy\Secrets\$MACHINE.ACC, readable only as SYSTEM and converted with w32tm /ntte, per Microsoft's secure channel data-collection guide.

Then check what Active Directory holds:

powershell
Get-ADComputer PC01 -Properties PasswordLastSet | Format-List Name, PasswordLastSet

Whichever side shows the newer date holds the newer password.

If Active Directory is the older side, the problem lives on the domain controllers. Microsoft lists replication issues, a DC restored from backup, or an authoritative restore of the computer object. Repairing the laptop won't hold until the domain side is healthy again.

If the device is the older side, something rolled the device back. That's the common case, and the next section covers it.

Why it keeps happening

Microsoft's list of causes for a device holding an older password is short, and each one is a rollback:

  • Snapshot revert. A VM goes back to a checkpoint taken before its last password change.
  • Bare-metal restore. A physical or virtual machine comes back from an old image backup.
  • System restore point. Windows rolls back to an earlier state, logged as event 1208 or 8202.
  • Power loss. After an unexpected shutdown, the recovery screen's default restores the last restore point, and Windows Embedded devices can lose a password changed just before the power went. Events 41 and 6008 log the shutdown.
  • Cloned or non-persistent machines. Images and pooled VDI desktops reset to a snapshot at sign-out.

Microsoft's tip for spotting a rollback is to look for a jump in time in the event logs. A machine in daily use with no events between February and July has been somewhere it shouldn't. A very recent boot time, event 12, is the other clue.

Cloning catches people out the most. In this r/sysadmin thread, one reply describes someone cloning domain-joined workstations, then a tech rejoining each one by hand whenever it broke. Another reply offers the same PowerShell repair as a faster fix than rejoining.

When a Windows Update breaks the trust

Rollbacks aren't the only cause. After the September 8, 2026 security update (KB5124008) or the September 14 out-of-band update (KB5129195), some Windows 11 devices lost their secure channel and showed this exact error, per Microsoft's Windows 11 release health page. Cached sign-ins kept working, and domain controllers weren't affected.

The trigger was Machine Identity Isolation, a Credential Guard protection for machine accounts. The updates made Windows honor existing settings that enforced it, and enforcement only works with domain controllers at the Windows Server 2025 domain functional level. Devices with enforcement configured against older domains lost trust.

Microsoft resolved it with KB5124010 on September 22, 2026, which turns Machine Identity Isolation enforcement off entirely. Devices on that update or a later one need no workaround. On a device stuck on an earlier build, apply the Known Issue Rollback policy or disable Machine Identity Isolation the same way it was enabled, whether through Intune, Group Policy or the registry. Then restart and run the Test-ComputerSecureChannel -Repair fix above.

A pilot ring that includes a few domain-joined laptops catches this kind of regression before it reaches every desk. Our Patch Tuesday guide lays out the rings and the release health check that goes with them.

Remote laptops and VPNs

Time away from the office doesn't break trust by itself. When a laptop can't find a domain controller, Netlogon skips the password change and keeps the old password, as Microsoft's secure channel post for remote workers explains. The risk is partial contact, such as a VPN or firewall that lets the laptop find a DC but blocks the rest of the traffic. Then the laptop can save a new password that the DC never receives.

This case came up on r/sysadmin in October 2025. An MSP had a small client with one domain controller, four desktops and four laptops. Only the laptops kept losing trust, and they were the ones on VPN.

The replies point three ways. The most upvoted one says to check time skew, since Kerberos fails when clocks drift more than a few minutes, and our time synchronization fix order covers that repair. The next two ask whether those laptops need on-premises AD at all, and suggest joining them to Entra ID instead. Another commenter explains that Windows does its domain work at logon, so a VPN that comes up afterwards misses it.

Entra join is worth weighing for devices that never come into the office, since an Entra joined device has no AD computer account to fall out of step. Our Entra ID vs Active Directory guide covers what changes. If they stay domain-joined, a VPN that connects before logon gives them steady contact with a DC.

Stop it across a fleet

Prevention is mostly about not fighting the defaults.

Keep the machine account password age at 30 days. Microsoft recommends that value, and warns that disabling password changes gives an attacker more time to guess a machine account's password. Turning changes off to stop this error trades one problem for a worse one.

Treat snapshots as part of the risk. A checkpoint older than 30 days is likely to hold a stale machine password, so reverting a domain-joined VM means planning a secure channel repair straight after. The same goes for image-based restores.

Check stale-computer cleanup too. A script that disables or deletes inactive computer accounts breaks trust on a laptop that was only away, so exclude remote devices or give them a longer window.

Then check before users do. Test-ComputerSecureChannel returns True or False, which makes it easy to run on a schedule across every machine and alert on the failures. In OpenFrame, that's a scheduled script run across devices in bulk, with approval gates before any repair runs. Any RMM that runs scripts can do the same check.

Fix it once, then find the cause

The repair takes one line and a reboot. The cause takes a few minutes of reading event logs, and it's what stops the ticket coming back.

If the same machines keep dropping off the domain, look at what rolled them back, what blocked their DC traffic halfway, or what disabled their accounts. For the next logon-time failure on the list, our guide to fixing slow DNS lookups is the next read.

Aliaska Varieva

Aliaska Varieva

VP of Engineering

Hi! I’m Aliaska, and I’ve been working as a software engineer (mostly Java + a bit Kotlin) for over 8 years now. I mostly spend my time building backend services, integrating systems, fixing bugs (the fun part 🙃), and making sure things don’t fall apart behind the scenes.

Related Content

Frequently Asked Questions

/blog/trust-relationship-failed

Still deciding?

Ask Mingo answers from our docs and customer stories.

Loading related content and questions