Run Test-ComputerSecureChannel first. If it returns $false, the workstation has lost its domain secure channel, and domain logon, Group Policy, and access to domain resources can fail until you repair it with valid credentials and check again before rebooting.

This applies to a domain member computer, not a domain controller. Use a local Administrator account if domain logon is broken. If you can still sign in to the domain, a domain admin or delegated reset account is the better choice for the repair command.

What the trust error means

What the trust error means
Windows domain and computer name settings dialog boxes are shown

Likely causes

The usual causes are a computer account password mismatch, NetLogon not running, or a controller, DNS, or time-source problem that blocks the trust path. Event ID 3210 points to NETLOGON authentication trouble, Event ID 8019 points to host record registration trouble, and Event ID 130 points to time-service trouble tied to the failed trust path.

Computer account password mismatch

  1. Open an elevated PowerShell session on the workstation with a local Administrator account.
  2. Run Test-ComputerSecureChannel first to confirm the secure channel state.
  3. If it returns $false, run Test-ComputerSecureChannel -Repair.
  4. If the machine cannot authenticate normally, add -Credential with an account allowed to reset the computer account.
  5. If you need a specific domain controller, add -Server "DCName.fabrikam.com" to point the reset at that controller.

NetLogon service not running

  1. Open Services or run Get-Service Netlogon in PowerShell.
  2. Confirm the NetLogon service is running before retrying repair.
  3. If it is stopped, start it and rerun Test-ComputerSecureChannel -Repair.
  4. If you still need to target a controller, add -Server "DCName.fabrikam.com".
  5. If local authentication is broken, supply -Credential for a domain admin or delegated reset account.

Controller reachability, DNS, or time-source trouble

  1. Check whether the domain controller named in -Server is reachable from the workstation.
  2. If Event ID 8019 appears, verify DNS registration and name resolution before another reset attempt.
  3. If Event ID 130 appears, confirm the machine can reach a valid domain time source.
  4. Run Test-ComputerSecureChannel again after connectivity is corrected.
  5. If the secure channel still fails, switch to Reset-ComputerMachinePassword with the same domain credential and controller.

Domain trust repair picker

Domain trust repair picker
A Windows PowerShell window shows a credential request dialog
Symptom Likely cause Recommended command Required credentials Remote-safe Expected output Fallback if it fails
Logon fails with the trust error Computer account password mismatch Test-ComputerSecureChannel None for a read-only check Yes $true or $false Run Test-ComputerSecureChannel -Repair
$false from the test Broken secure channel Test-ComputerSecureChannel -Repair Domain admin or delegated reset account if local auth is not enough Yes $true after repair Use Reset-ComputerMachinePassword -Server "DCName.fabrikam.com" -Credential
Repair says access denied Credential lacks reset rights Reset-ComputerMachinePassword Delegated computer-reset account or domain admin Yes Password reset completes without error Switch to another delegated reset account
Repair cannot contact the domain Controller, DNS, or NetLogon issue Test-ComputerSecureChannel -Repair -Server "DCName.fabrikam.com" -Credential Domain admin or delegated reset account Yes, if the controller is reachable Secure channel restored Check NetLogon, DNS, and Event IDs 3210, 8019, and 130

How do you check trust first?

Run Test-ComputerSecureChannel first, because it checks the secure channel and returns $true when the channel works and $false when it does not. Add -Server when you want the check to hit a specific domain controller. That gives you a clear yes-or-no before you try a repair.

Example: Test-ComputerSecureChannel -Server "DCName.fabrikam.com" checks against a named controller. If you want a quick conditional script, Microsoft’s own syntax uses the same pattern: test first, then continue only if the channel is healthy.

Say your finance laptop sits on Wi-Fi and loses domain access after a password change. A plain Test-ComputerSecureChannel call tells you if the fault is trust, not just broad network loss.

How do you repair it with PowerShell?

Use Test-ComputerSecureChannel -Repair when the check comes back false. The Repair parameter removes and rebuilds the channel established by NetLogon, and you can add -Credential when the machine cannot authenticate normally. If you need to aim at a controller, add -Server "DCName.fabrikam.com" to the same command.

Run the repair from a local Administrator account if domain sign-in is unavailable. If the account you are using does not have permission to reset the computer account, switch to a delegated reset account or a domain admin account that can perform the action.

  1. Open PowerShell as an administrator on the member computer.
  2. Run Test-ComputerSecureChannel -Repair.
  3. If the machine cannot authenticate, add -Credential with a permitted domain account.
  4. If you want a specific controller, add -Server "DCName.fabrikam.com".
  5. Run Test-ComputerSecureChannel again and confirm it returns $true.

Should you use Reset-ComputerMachinePassword?

Use Reset-ComputerMachinePassword when the secure-channel repair path fails or when you want a direct machine-account password reset against a chosen controller. It is often paired with -Server and -Credential, especially when the workstation cannot authenticate normally and the first repair command does not complete.

Example syntax: Reset-ComputerMachinePassword -Server "DCName.fabrikam.com" -Credential (Get-Credential). That pattern fits a delegated reset account or domain admin account. If it still fails, stop and verify controller reachability, NetLogon, and the computer account’s status before trying again.

  1. Run PowerShell as a local Administrator on the workstation.
  2. Supply a domain admin or delegated reset account with -Credential.
  3. Specify the controller with -Server "DCName.fabrikam.com" if you need a target.
  4. Run the reset command.
  5. Recheck trust with Test-ComputerSecureChannel.

What if the repair still fails?

What if the repair still fails?
A Windows PowerShell window shows the words repair trust relationship

If the first repair fails, do not guess. Check NetLogon, controller reachability, and the credential you supplied, then try the alternate command. A clean domain repair path still depends on a live controller and an account with rights to reset the machine account.

  1. Confirm the NetLogon service is running.
  2. Verify the domain controller named in -Server is reachable.
  3. Use a domain admin or delegated reset account, not only a local admin account.
  4. If Test-ComputerSecureChannel -Repair fails, try Reset-ComputerMachinePassword with the same controller and credential.
  5. If the computer account object is missing or the controller cannot be contacted, stop and escalate to directory services support.

Suppose a branch laptop shows Event ID 3210 after a password change and the reset account lacks the right delegation. The fastest next step is not a reboot; it is to retry with a permitted reset credential against a reachable controller.

Still not working?

If the machine still cannot reach a controller or the computer account is broken in the directory, the next move is an administrative directory fix rather than more local retries.

A reboot is often not required. Validate the secure channel first, then test domain logon and access to a domain resource. If the secure channel returns $true and logon still fails, the remaining issue is outside the trust repair path.

For prevention, keep the workstation pointed at a reachable domain controller and avoid long periods off the network after password changes. That lowers the chance of a stale machine password and a broken trust path.

Frequently asked questions

How do I fix the trust relationship between this workstation and the primary domain failed in PowerShell?

Start with Test-ComputerSecureChannel. If it returns $false, run Test-ComputerSecureChannel -Repair from an elevated PowerShell session on the member computer. If the machine cannot authenticate normally, add -Credential for a domain admin or delegated reset account, then verify the result with another trust check.

What PowerShell command repairs a broken domain trust relationship?

Test-ComputerSecureChannel -Repair is the primary repair command. It can also take -Server "DCName.fabrikam.com" and -Credential when you need a specific controller or a permitted account for the reset. If that still fails, Reset-ComputerMachinePassword is the next command to try.

Do I need to reboot after repairing domain trust with PowerShell?

Usually no. Recheck the secure channel with Test-ComputerSecureChannel, then test domain logon or access to a domain resource. If the channel is healthy and the login still fails, the problem is no longer the trust relationship and needs a different fix.

Why does Test-ComputerSecureChannel return False?

$false means the secure channel is not healthy. The usual reasons are a computer account password mismatch, a NetLogon problem, or a controller, DNS, or time-source failure that blocks trust repair. Check Event ID 3210, Event ID 8019, and Event ID 130 to separate those paths.

Should I use Test-ComputerSecureChannel or Reset-ComputerMachinePassword?

Use Test-ComputerSecureChannel first because it tells you whether the secure channel is healthy. Use Test-ComputerSecureChannel -Repair next if it returns false. Switch to Reset-ComputerMachinePassword when the repair path fails, or when you want a direct machine-password reset against a specific controller.

Can I repair domain trust remotely with PowerShell?

Yes, if the target is a domain member computer and the controller is reachable. Use -Server "DCName.fabrikam.com" to point at a controller, and supply -Credential when the local machine cannot authenticate normally. The command still needs rights to reset the machine account.