Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › Active Directory

How to Fix “The Trust Relationship Between This Workstation and the Primary Domain Failed”

By Freedom251 Team · · 10 min read

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The error means Windows cannot authenticate the computer’s secure channel to Active Directory. In most cases, the machine-account password stored on the PC no longer matches the copy held by a domain controller. Sign in with a local administrator, verify DNS and domain-controller connectivity, test the channel with Test-ComputerSecureChannel, and repair or reset the machine password. If the account is missing, corrupted, or replication is involved, reset the computer account or rejoin the PC to the domain.

What the trusted-relationship error means

Windows domain membership depends on a secure channel between the workstation and a domain controller. During normal domain authentication, the computer proves its identity with a machine-account password that is maintained in both places. The exact Windows message is: “The trust relationship between this workstation and the primary domain failed.”

As an Amazon Associate I earn from qualifying purchases.

A failure does not automatically mean that a user typed the wrong password or that the workstation is infected. It indicates that the computer could not complete domain authentication. Microsoft identifies an unsynchronized machine password as the usual cause. A deleted or corrupted computer account in Active Directory can produce the same result. In an Azure virtual-machine scenario, the equivalent problem is that the secret on the VM differs from the secret on the domain controller.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you may see

  • A domain user cannot sign in, while a local account still works.
  • A previously cached domain sign-in may work when the computer is disconnected, but a new domain authentication fails.
  • Windows may record Netlogon Event 3210.
  • Applications or services that use the computer’s domain identity may lose access to network resources.

The message is about the workstation’s computer account, not just one user profile. Repairing the secure channel normally preserves the user’s data, but changing domain membership can affect profiles and policies, so use rejoining as a fallback rather than the first action.

Prepare before changing the domain relationship

Use a local administrator session

Have a local administrator account and its password ready before you begin. If domain sign-in is unavailable, choose Other user at the sign-in screen and enter the local account in a form such as . ackslashbackslashAdministrator or COMPUTERNAMEbackslashbackslashLocalAdmin, according to your organization’s naming. A domain account that is allowed to reset the computer account is also required for the repair commands.

Record the information you will need

  • The Active Directory domain name, for example, the name shown in your organization’s sign-in format.
  • At least one reachable domain controller name.
  • A domain credential authorized to reset the workstation’s computer account.
  • The workstation name, which you can view in Settings > System > About or with the hostname command.

Do not start a domain-unjoin operation until you know the local administrator password. If the computer is managed remotely, arrange an out-of-band or console connection in case a restart leaves the network adapter or VPN unavailable.

Diagnose the failure before repairing it

1. Confirm that the computer can reach a domain controller

Connect the PC to the organization’s network. A wired connection is useful for a first test because it removes Wi-Fi roaming and captive-portal variables. If the machine is remote, connect the company VPN before testing; the VPN must provide access to a domain controller, not merely internet access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check that DNS resolves the Active Directory domain and its domain controllers using the organization’s DNS servers. A workstation pointed only at a public DNS service may browse the web yet fail domain authentication. Also check basic routing and firewall policies between the workstation and the domain controller. Microsoft’s troubleshooting guidance specifically calls out interrupted network communication and blocked Active Directory ports as possible causes.

2. Test the secure channel

Open Windows PowerShell as administrator and run:

Test-ComputerSecureChannel

The cmdlet returns True when the secure channel is working and False when it is broken.

Result or finding What it means Next action
False The workstation and domain disagree about the secure channel, or the channel cannot be reached. Verify DNS and connectivity, then run the in-place repair.
True The secure channel is not the immediate fault. Investigate DNS, routing, authentication, account permissions, time or policy issues, and the specific sign-in error instead of repeatedly resetting the machine password.
The command cannot contact a domain controller The test cannot make a valid determination because the required network path is unavailable. Resolve VPN, routing, firewall or DNS problems first.

A successful test does not prove that every domain service is healthy; it only says that this particular computer-to-domain secure channel responded successfully at the time of the test.

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Repair the channel with PowerShell

Use the built-in repair operation

In the same elevated PowerShell window, run the documented repair command:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

A credential prompt appears. Enter a domain account permitted to reset the computer account. The command attempts to synchronize the machine password without removing the computer from the domain. Run the diagnostic command again afterward:

Test-ComputerSecureChannel

A True result confirms that the secure channel now responds. Restart Windows and try the domain sign-in again. If the command returns an error, capture the complete text; it usually distinguishes a credential, connectivity or account problem.

Reset the machine password explicitly

If the repair switch does not restore the relationship, reset the machine password directly:

$credential = Get-Credential
Reset-ComputerMachinePassword -Credential $credential
Restart-Computer -Force

The restart is part of the procedure. After Windows comes back, sign in with the domain account and, if necessary, run Test-ComputerSecureChannel once more from an elevated PowerShell window. A reset can fail when the named credential lacks permission, when DNS points to the wrong servers, or when the computer account in Active Directory is absent or damaged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Repair from an elevated Command Prompt with Netdom

Netdom provides an alternative when you prefer Command Prompt or when PowerShell is unavailable. Open Command Prompt as administrator and substitute your actual names.

Rank #3

Verify the relationship

netdom verify ComputerName /domain:YourDomainName

This checks the workstation against the specified domain. Replace ComputerName with the workstation’s name and YourDomainName with the Active Directory domain.

Reset the workstation password against a domain controller

netdom resetpwd /server:DomainControllerName /userd:DomainUsername /passwordd:*

The asterisk causes Netdom to prompt for the password rather than exposing it in the command line. Use a domain controller that the workstation can reach. Restart the computer after the reset and retry domain sign-in.

Reset the secure relationship for the domain

netdom reset /domain:YourDomainName /userd:DomainUsername /passwordd:*

Again, supply credentials at the prompt and restart afterward. Keep the command output and any error text if the operation fails; it can show whether the issue is authentication, name resolution or access to the domain controller.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Nltest when the two password copies differ

Microsoft documents the following command for a machine-password mismatch between the workstation and its domain controller:

nltest /sc_change_pwd:DomainName

Replace DomainName with the Active Directory domain. Restart Windows after the command completes and test the domain sign-in. Nltest.exe is available through Remote Server Administration Tools and Windows support tools; availability depends on what is installed on the workstation.

If password repair fails

Resolve DNS, routing and firewall problems first

Do not keep repeating reset commands while the computer cannot reach a domain controller. Confirm that the active network adapter uses the organization’s DNS servers, that the domain name resolves to the expected infrastructure, and that routing permits traffic to a domain controller. Review host and network firewalls for blocked Active Directory ports. Reconnect the VPN or move to the corporate network, then rerun Test-ComputerSecureChannel and the repair command.

Rank #4
Windows 11 Laptop with i3 Processor 15.6" Work Laptop for College Students | Backlit Keyboard WiFi 6 (2 cores, 4 Threads, up to 3.4GHz) 12GB RAM 256GB SSD TF Card Expandable to 2TB
  • 【Efficient Performance】 Powered by Intel Core i3 processor (2 cores, 4 threads, up to 3.4GHz) with 12GB RAM and 256GB SSD. Handles multitasking, office software, online classes, and HD video streaming smoothly. Integrated Intel UHD Graphics 620
  • Backlit Keyboard & Complete Package】Comes with a cool backlit keyboard. Comes with awebcam, dual stereo speakers (8Ω/1.0W each), DC charger, and user manual – ready for late-night studying, online classes, video conferencing, and daily productivity
  • 【Vibrant Display】 15.6-inch Full HD (1920x1080) anti-glare screen with 16:9 aspect ratio delivers crisp images and vivid colors – perfect for studying, watching lectures, or entertainment. Thin-bezel design maximizes viewing area
  • 【Fast Connectivity & Expansion】 Equipped with WiFi 6 (802.11ax) and Bluetooth 5.2 for stable, high-speed wireless. Features 3 x USB 3.0, HDMI 2.1, Type-C (supports PD3.0 fast charging), and a TF card slot expandable up to 2TB – easily connect external monitors, mice, drives, or expand storage for all your files
  • 【Long Battery Life & Portable】 Built-in 11.55V 5000mAh/57.75Wh high-capacity battery delivers approximately 7 hours of mixed-use battery life – enough for a full day of classes and assignments. Lightweight at just 1.63kg (3.6 lbs) and 19.5mm thin, plus a compact packing size – easily slips into a backpack for campus, library, or coffee shop

Consider Active Directory replication

In a multi-controller environment, one domain controller may hold a newer machine password than another. A workstation can therefore appear healthy when tested against one controller and fail against another. Microsoft’s broken-trust guidance distinguishes cases where Active Directory has the newer password from cases where the client has the newer password. If you suspect replication, collect Netlogon and directory-service events, identify which domain controller handled the failed authentication, and have an Active Directory administrator review replication status before deleting or recreating accounts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether the computer account was deleted or corrupted

Search Active Directory Users and Computers, or ask an administrator to do so, for the workstation’s computer account in the expected organizational unit. A deleted account cannot be repaired solely from the workstation. A disabled, moved or corrupted account may also require administrative correction. Avoid creating a second account with a similar name until the original object and replication state are understood.

Use the rejoin procedure when the channel cannot be repaired in place

If network access is healthy, credentials are valid, and password-reset commands still fail, remove and rejoin the computer to the domain. This is the documented fallback for standard domain members and for affected Azure VMs.

  1. Sign in with a local administrator account and ensure you know its password.
  2. Open the System Properties dialog by pressing Windows key + R, entering sysdm.cpl, and pressing Enter.
  3. On the Computer Name tab, select Change. Temporarily select Workgroup, enter a workgroup name, and confirm with an account authorized to change membership.
  4. Restart when Windows requests it. This leaves the domain; domain users may not be able to authenticate until the rejoin is complete.
  5. Open sysdm.cpl again, select Change, choose Domain, enter the correct domain name, and provide domain credentials with permission to join computers.
  6. Restart after Windows confirms the join. Connect to the organization’s network or VPN before the restart if required for policy and authentication.
  7. Sign in with a domain account, allow policy processing to complete, and verify access to a known domain resource.

Before leaving the domain, back up important local data and note any encryption or management requirements. A rejoin can create a new security identity for the computer and may require administrators to restore the computer account’s organizational-unit placement, group memberships, delegated permissions or management enrollment. Existing user profiles normally remain on disk, but Windows may associate a newly signed-in domain account with a new profile; an administrator can map or migrate data when necessary.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Azure VM-specific considerations

For an Azure virtual machine joined to a domain, the underlying issue can be a different machine secret on the VM and the domain controller. Start with the same sequence: obtain a local administrator session, establish network and DNS access to a domain controller, test the secure channel, and attempt password repair. If the VM cannot reach the domain or the computer account is no longer valid, use the domain rejoin process after coordinating with the administrators who manage the VM and Active Directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the least disruptive path

Situation Preferred path Why
You can sign in locally, DNS works, and the test returns False. Test-ComputerSecureChannel -Repair, followed by a retest and restart. It repairs the channel without changing domain membership.
The repair switch fails but the domain controller is reachable. Reset-ComputerMachinePassword, Netdom, or Nltest. These perform an explicit machine-password reset using authorized credentials.
The workstation cannot resolve or reach a domain controller. Fix DNS, VPN, routing or firewall access first. Password commands cannot succeed without the required domain path.
The computer account is deleted, disabled, corrupted or affected by replication. Have an Active Directory administrator correct the account or replication state. Local commands cannot recreate a valid directory object safely in every case.
Connectivity and account repairs fail repeatedly. Remove the PC to a workgroup, restart, and join it to the domain again. Rejoining creates a fresh secure relationship, but has greater administrative impact.
Test-ComputerSecureChannel returns True. Stop secure-channel resets and investigate the separate sign-in or policy fault. The channel is not the immediate cause shown by that test.

Validate the result after recovery

  • Run Test-ComputerSecureChannel from elevated PowerShell and confirm True.
  • Restart once after a successful password reset or domain rejoin.
  • Sign in with a domain account while connected to the organization’s network.
  • Open a known domain resource that previously failed, such as a managed share or service.
  • Check Event Viewer for new Netlogon errors; Event 3210 should not continue appearing for the same incident.
  • Confirm that Group Policy and management tools can communicate with the workstation.

Common mistakes to avoid

  • Using a domain account when domain authentication is broken: perform the repair from a local administrator session.
  • Resetting against an unreachable controller: verify DNS and routing before entering credentials.
  • Ignoring the command result: a True test means the secure channel is not the immediate fault; pursue another diagnosis.
  • Deleting the computer account too early: replication may leave another controller with the newer password, and deletion can increase recovery work.
  • Leaving the domain without local credentials: you can lock yourself out after the restart.
  • Assuming a rejoin fixes every sign-in problem: profile, policy, time, DNS and permissions issues can remain after membership is restored.

As an optional shortcut after the manual checks, Outbyte PC Repair can address more than 100 common Windows issues where possible, including broken system elements and shared DLL problems, while also offering settings tweaks, temporary-file cleanup, privacy and vulnerability checks, a real-time boost, file shredder and crash log. It runs on Windows 11, 10, 8 and 7; its category-based free trial lasts at least two days before a subscription. It complements antivirus software rather than replacing it, results vary, and no tool repairs every crash.

Bottom line

Start with local administrator access and a working path to a domain controller. A False result from Test-ComputerSecureChannel usually points to a machine-password mismatch, so repair it in place with PowerShell, Netdom or Nltest and restart. If DNS, firewall, replication or the computer account itself is at fault, correct that underlying issue; rejoin the domain only when in-place repair cannot restore the secure channel.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Active DirectoryDomain TrustnetdomnltestPowerShellTroubleshootingWindows

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.