# Rebinding a Workstation to a Domain



## lochlomonder (Jul 24, 2015)

I'm sure domain administrators have seen this infamous message more than once: "_The trust relationship between this workstation and the primary domain failed_." More often than not, this has required removing the workstation from Active Directory, deleting the associated Computer object, and then re-adding it to the domain. Here's a quicker way to do it:


Log on to the affected machine using the Workstation Administrator account.
Open PowerShell with Administrative privileges.
Enter the following commands:
*$credential = Get-Credential* (enter the Domain Administrator password when prompted)

*Reset-ComputerMachinePassword -Server DC -Credential $credential *(replace *DC* with the name of your closest domain controller)

This will re-bind the workstation to the domain in a couple of steps, instead of having to go through the rigmarole noted in the first paragraph.

Source


----------



## valis (Sep 24, 2004)

Thanks, this is very good to know. I see this error waaaay too much and its always a pain.


----------



## lochlomonder (Jul 24, 2015)

Same here, valis. This was such an easy fix, I thought it would be good to share with fellow administrators on the forum.


----------



## Triple6 (Dec 26, 2002)

You don't need to remove the computer from the domain or delete it from AD, just run the Network ID Wizard to re-join it, it also keeps the computer in the correct OU and everything.


----------



## lunarlander (Sep 22, 2007)

Thanks


----------

