Fix : The trust relationship between this workstation and the primary domain failed

Scouring the internet for a solution to “The trust relationship between this workstation and the primary domain failed” has hopefully brought you here.

If like me you tried the following Powershell commands…

$credential = Get-Credential – (enter domain admin account when prompted)
Reset-ComputerMachinePassword -Credential $credential -Server dc-hostname.domain

Reset-ComputerMachinePassword -Server dc-hostname.domain

Test-ComputerSecureChannel -Repair -Credential (get-credential)

…and they failed, then be sure to do the following three things:

  1. Make sure you are running PowerShell 3.0 or newer.  That is because older versions of PowerShell do not support certain parameters.  Download at ; you will be asked to reboot the system.
  2. Run As Administrator – Log in to an Administrator account, right-click over PowerShell and select to Run As Administrator.
  3. Execute the following PowerShell Command as it worked for me (typed exactly as seen below):

Test-ComputerSecureChannel -Repair -Credential (get-credential)

After hitting enter, I was prompted for the domain administrator credentials.  And it worked; no reboot needed.

#credential-get-credential, #powershell, #reset-computermachinepassword, #test-computersecurechannel, #the-trust-relationship-between-this-workstation-and-the-primary-domain-failed