Skip to content

Est. 2011ยทMicrosoft Partner 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

License Error 0xC000018D

Trust relationship failed: error 0xC000018D between the PC and the domain

11 min read Updated October 5, 2026 Networking, Sharing & Printing

Recommended fix

Windows 11 Pro Retail license

Original price was: 25,00 €.Current price is: 14,99 €.

Fix It Now

Fix it now

“The trust relationship between this workstation and the primary domain failed” means the computer’s own account password no longer matches the copy Active Directory holds. No user account is at fault and no data is lost. In most cases the repair takes two commands and does not require leaving the domain.

Sign in as a local administrator, then run these in an elevated PowerShell

nltest /sc_query:contoso.local
Test-ComputerSecureChannel -Verbose
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)
  1. Sign in with a local administrator account. The domain account will not work until this is fixed.
  2. Confirm a domain controller is actually reachable with nltest /dsgetdc:contoso.local. If that fails, the fault is network or DNS and none of the rest applies.
  3. Read the nltest /sc_query output. Microsoft documents this failure as returning “Status = 5 0x5 ERROR_ACCESS_DENIED” from that command.
  4. Repair the secure channel with the third command, supplying a domain account with rights to reset the computer object.
  5. If that cmdlet is unavailable, use Reset-ComputerMachinePassword -Server dc01.contoso.local -Credential (Get-Credential) instead.
  6. Reboot and sign in with the domain account.

Check the System log for NETLOGON Event 3210 and for a NlSessionSetup entry reading “cannot I_NetServerAuthenticate 0xc0000022”. Microsoft names both as symptoms of this fault, and they confirm the diagnosis before you change anything.

If a domain sign-in works, you are done. If the machine has no domain option at all, the next section explains why, and it is not something a command fixes.

Why it happens

Joining a domain creates an object in Active Directory for the machine itself, with a password the machine generates and changes on its own schedule. That password secures the secure channel: the private conversation between the machine and a domain controller that carries every Kerberos and NTLM operation the machine performs on its own behalf. Break it and nothing that depends on the domain works, including the logon you are trying to perform.

Microsoft names two causes, and they are opposites of each other. Either the client has an older password than the directory holds, or the directory has an older password than the client – which happens when a domain controller is restored to a previous state, or when replication is not working. Restoring a machine from an image or snapshot older than its last password change produces the first. Deleting and recreating the computer object gives the machine an identity it knows nothing about. Cloning without generalising leaves two computers sharing one object, each changing the password out from under the other.

It is worth separating this from the codes that travel with it, because two of them are not about the machine password at all. 0x8007051F is Win32 1311, “There are currently no logon servers available to service the logon request.” 0x8007054B is Win32 1355, “The specified domain either does not exist or could not be contacted.” A laptop on a home network with no VPN, or a machine whose DNS points at a public resolver rather than a domain controller, produces very similar-looking failures for an entirely different reason and no amount of secure channel repair will help.

The machine password is out of date after a restore

You have this one if It worked before the restore, the computer object still exists, and a domain controller is reachable.

  1. Run the repair from a local administrator session, supplying domain credentials with permission to reset the object.
  2. Reboot and sign in with a domain account to confirm.
  3. If you restore from images regularly, note that any image older than the last machine password change will do this again.

Neither repair command needs the machine to leave the domain. Rejoining is a valid remedy that Microsoft recognises, but it is the heavier one and it costs you whatever is attached to the existing object.

The directory’s copy is older than the machine’s

You have this one if A domain controller was restored, or replication has been failing, and several machines started reporting this at once.

  1. Check replication health before repairing anything, because repairing against a stale controller writes the new password somewhere it will be overwritten.
  2. Repair against a controller you know is current: Reset-ComputerMachinePassword -Server <good-dc>.
  3. Fix the replication problem, or you will be doing this again on the next batch of machines.

The computer object was deleted or disabled

You have this one if Get-ADComputer -Identity <name> returns nothing, or returns an object marked disabled.

  1. If the object is disabled, enable it and retry the repair.
  2. If it was deleted and the Active Directory Recycle Bin is enabled, restore the object rather than recreating it, so group memberships and stored attributes come back with it.
  3. Only if there is nothing to restore, remove the machine from the domain and rejoin it.

Deleting and recreating a computer object loses everything attached to it, including BitLocker recovery information and any local administrator password stored on the object. Check what you would be discarding first.

Two machines are sharing one computer account

You have this one if The fault alternates between two machines, each working after a repair until the other one is used.

  1. Compare the machine names. A clone taken without generalising the source keeps the original identity.
  2. Rename one machine and rejoin it so each has its own object.
  3. Rebuild the deployment image with the system preparation tool so future machines get unique identities.

No domain controller can be reached

You have this one if 0x8007051F or 0x8007054B rather than the trust message, and nltest /dsgetdc: fails.

  1. Check the adapter’s DNS servers with ipconfig /all. A domain member must use domain DNS servers, not a router or a public resolver.
  2. Flush the resolver with ipconfig /flushdns and retry nltest /dsgetdc:contoso.local.
  3. For remote machines, make sure the VPN connects before sign-in, or that the user has cached credentials to reach the desktop first.

Full reference

The codes, and which are about the trust at all

Code Published meaning About the machine password?
0xC000018D No meaning published for this status value This is the status form of the trust failure, but Microsoft publishes no text for it
0x800706FD Win32 1789: the trust relationship between this workstation and the primary domain failed Yes. This is the documented form
0x8007054B Win32 1355: the specified domain either does not exist or could not be contacted No. Name resolution or reachability
0x8007051F Win32 1311: there are currently no logon servers available to service the logon request No. Controller availability

If you want a code you can quote to somebody, use 0x800706FD. Its published wording is the same sentence the user sees on the logon screen, so nobody has to take anyone’s word for what it means. 0xC000018D turns up in the same situation and Microsoft publishes no text for it, so describe it by what it accompanies rather than asserting a meaning.

What Microsoft names as the symptoms

  • The message “The trust relationship between this workstation and the primary domain failed. You can sign in using a local user or cached credentials.”
  • NETLOGON Event 3210 in the System event log.
  • An error log entry reading “NlSessionSetup: Session setup: cannot I_NetServerAuthenticate 0xc0000022”.
  • nltest /sc_query:<domain> returning “Trusted DC Connection Status Status = 5 0x5 ERROR_ACCESS_DENIED”.

Those four together are as close to a definitive diagnosis as this fault offers, and they take two minutes to collect. Collect them before you start changing things, because the repair looks the same whether or not it was the right repair.

Joining a domain: which editions can

Microsoft publishes the list of client editions that can join a domain: Enterprise, Enterprise N, Pro, Pro N, Pro Education, Pro Education N, Pro for Workstations, and Pro N for Workstations. Home is not on it. If System Properties has no domain option at all – the field absent rather than greyed out – that is what you are looking at, and no registry change or third-party tool alters it.

Route Steps
Settings Start, Settings, Accounts, Access work or school, Connect, then “Join this device to a local Active Directory domain”. Enter the domain name, then the credentials, then restart
Command line netdom join %COMPUTERNAME% /domain:YourDomainName /userd:DomainUsername /passwordd:*

Repairing rather than rejoining

Command What it does
Test-ComputerSecureChannel -Verbose Tests the secure channel and reports True or False
Test-ComputerSecureChannel -Repair -Credential (Get-Credential) Resets the machine password in both places, in situ
Reset-ComputerMachinePassword -Server <dc> -Credential (Get-Credential) The same repair against a named controller, which matters if replication is suspect
nltest /sc_query:<domain> Shows the secure channel state and which controller it points at
nltest /dsgetdc:<domain> Shows whether a controller can be found at all

Repair against a controller you trust to be current. If the directory’s copy of the password is the stale one because a controller was restored or replication is broken, repairing against that controller writes a value that will be overwritten, and the machine falls out again a few hours later looking like an intermittent fault.

When a licence is the actual fix

Every cause above except one is repaired free with commands already on the machine, and that is where most readers will finish. The exception is a genuine edition limit. Microsoft’s own list of editions that can join a domain covers Pro, Pro Education, Pro for Workstations and Enterprise, and their N variants. Home is not on it, cannot be repaired into it, and no registry change or third-party tool makes it possible. If the machine that keeps falling out of the domain turns out to be Home, or a new machine arrived with Home preinstalled and somebody has been trying to join it all morning, the fix really is the licence: a Windows 11 Pro upgrade licence, entered as a product key, converts the installation in place with files and applications left alone. Arco supplies the Pro upgrade licence and can confirm from your current edition and activation state which upgrade path applies before you order. If the machine is already Pro, Enterprise or Education, ignore this entirely and run the repair command.

Every code this article covers

Code What it points at Source
0xC000018D Microsoft publishes no text for this status value. It accompanies the trust failure described here; the documented form of the same failure is Win32 1789, whose text is “The trust relationship between this workstation and the primary domain failed” not published by the vendor
0x8007054B Win32 1355, ERROR_NO_SUCH_DOMAIN: the specified domain either does not exist or could not be contacted Microsoft Learn
0x8007051F Win32 1311, ERROR_NO_LOGON_SERVERS: there are currently no logon servers available to service the logon request Microsoft Learn
0x800706FD Win32 1789, ERROR_TRUSTED_RELATIONSHIP_FAILURE: the trust relationship between this workstation and the primary domain failed Microsoft Learn

Confirm the fix worked

  1. Test-ComputerSecureChannel returns True.
  2. Sign in with a domain account rather than the local administrator.
  3. nltest /sc_query:contoso.local reports a healthy connection to a named controller.
  4. Open a domain resource that failed earlier, such as a mapped drive, and confirm it opens without prompting.
  5. Check the System log the following day for a repeat, which would point at replication rather than at this machine.

Questions people ask about this

Do I have to remove the PC from the domain and rejoin it?

Usually not. Microsoft calls rejoining a valid solution, so it is not wrong, but it is the heavier option: it creates a new object and anything attached to the old one is lost. Try the secure channel repair first and reserve rejoining for cases where the object no longer exists.

Will this delete the user’s profile or files?

No. Repairing the secure channel changes one password in two places. Even a full rejoin keeps local profiles, though it creates a new computer object, and whatever was stored on the old one goes with it.

Can I stop it happening again?

Mostly. Restore machines from current images rather than old ones, generalise images before deployment, resync after any snapshot revert, and keep replication healthy. Disabling machine password changes to dodge the problem is a poor trade, because that password is what protects the secure channel.

Does Windows Home really not work here?

Correct. Microsoft’s published list of editions that can join a domain does not include Home. Home can add a work or school account for cloud services, which is a different thing entirely: it gives you neither Group Policy, nor domain logon, nor domain-based permissions.

It came back a few hours after I repaired it. Why?

Almost certainly because you repaired against a domain controller whose copy was the stale one, or because replication is not carrying the change. Repair against a controller you know is current and look at replication health.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

License Error Error 0x80092012: TLS inspection breaks certificate checks on the client Free Fix Print jobs stuck: error 0x00000040 and a print queue that will not clear License Error RDP error 0x80090326: the TLS handshake was rejected before logon Free Fix Error 0x0000070A: printer already exists or the driver is still in use
โ† Back to Knowledge Base