I recently migrated my Windows Primary Domain Controller from one server to another.A workstation running Windows 10 could not recognize the shared drive. So I changed the DNS to the new server and flushed the DNS. When I rebooted the workstaion it refused to logon the domain user as the 'trust relationship' between the workstation and the Primary domain controller was broken. There is no local user with admin privileges on the workstation. How do I bring back the workstation into the domain?
✦ This is a classic and tricky situation. The "broken trust
relationship" error occurs because the computer's account
password, which it uses to securely communicate with the domain
controller, is out of sync. Since you have no local administrator
account, you can't log in to fix it directly.
The solution involves using a Windows installation media to gain
temporary administrative access from the login screen, creating a
new local admin user, and then using that user to repair the trust
relationship.
Here is a step-by-step guide.
Disclaimer:
This procedure involves modifying system files. While generally
safe when followed carefully, it's always recommended to have a
backup of any critical data on the workstation before proceeding.
Part 1: Gaining Administrative Access
You will need a Windows 10 installation USB or DVD.
- Boot from Installation Media:
- Insert the Windows 10 installation media into the
workstation. - Restart the computer and boot from the media. You may need
to change the boot order in the BIOS/UEFI settings.
- Insert the Windows 10 installation media into the
- Open Command Prompt:
- On the initial Windows Setup screen, press
Shift + F10
to
open a Command Prompt.
- On the initial Windows Setup screen, press
- Replace Utility Manager with Command Prompt:
- First, you need to find the drive where Windows is
installed. It's usually C: or D: in the recovery
environment. You can find it by typing diskpart and then
list volume. - Assuming the Windows drive is C:, execute the following
commands to back up the Utility Manager (utilman.exe) and
replace it with the Command Prompt (cmd.exe):
c:\windows\system32\utilman.exe.bak
2 copy c:\windows\system32\cmd.exe
c:\windows\system32\utilman.exe - First, you need to find the drive where Windows is
- Reboot:
- Close the command prompt and reboot the workstation
normally, removing the installation media.
- Close the command prompt and reboot the workstation
- Open the SYSTEM Command Prompt:
- On the Windows login screen, click the Ease of Access icon
(it looks like a clock or a person) in the bottom-right
corner. - Because of the change made in Part 1, a Command Prompt will
open with NT AUTHORITY\SYSTEM privileges.
- On the Windows login screen, click the Ease of Access icon
- Create a New Local Admin User:
- In the command prompt, type the following commands,
replacing NewAdmin and Password123 with a username and
strong password of your choice.
2 net localgroup administrators NewAdmin /add - In the command prompt, type the following commands,
- Close the Command Prompt. Part 3: Repairing the Trust Relationship
- Log In:
- You should now see your new local user on the login screen.
Log in as that user (.\NewAdmin).
- You should now see your new local user on the login screen.
- Repair the Trust:
- Once logged in, right-click the Start button and select
Windows PowerShell (Admin). - In the PowerShell window, type the following command. It
will test and attempt to repair the secure channel to the
domain.
(Get-Credential)- A credential box will pop up. Enter the username and
password for a Domain Administrator account and click OK. - If the command returns True, the trust relationship has
been successfully repaired.
- Once logged in, right-click the Start button and select
- Reboot the Workstation. Part 4: Cleanup and Verification
- Log In with Domain Account:
- After rebooting, you should now be able to log in with the
original domain user account without the trust relationship
error.
- After rebooting, you should now be able to log in with the
- Restore Utility Manager (Important Security Step):
- To restore the original Ease of Access functionality and
secure your system, you must reverse the change from Part
1. - Boot from the Windows 10 installation media again.
- Press
Shift + F10
to open the command prompt. - Execute this command (assuming C: is your Windows drive):
c:\windows\system32\utilman.exe- Reboot normally.
functional. You can choose to keep the local admin account you
created for future emergencies or delete it. - To restore the original Ease of Access functionality and