"The trust relationship between this workstation and the primary domain failed." This error message stops you from logging in, accessing network resources, or using domain services. The computer can't authenticate with the domain controller because the secure channel (trust relationship) is broken.
This guide covers multiple solutions to fix trust relationship issues, from the proper fix (resetting the computer account) to temporary workarounds that get you back up and running quickly. Whether you need a permanent fix or just need to bypass the issue temporarily, these solutions will help.
TL;DR
- Proper fix: Reset computer account in AD, then reconnect from the computer
- Quick fix: Remove from domain, restart, rejoin domain
- PowerShell fix: Use
Reset-ComputerMachinePasswordorTest-ComputerSecureChannel -Repair - Temporary bypass: Use cached credentials or local admin account to access the computer
- Command line fix: Use
netdom resetto reset the secure channel - Common causes: Password sync issues, time differences, domain controller changes, extended offline periods
What Is a Domain Trust Relationship?
Every computer joined to a Windows domain maintains a secure channel (trust relationship) with a domain controller. This secure channel uses a computer account password that's automatically changed every 30 days. When this password gets out of sync, or the secure channel breaks, you get the trust relationship error.
Common causes include:
- Password synchronization failure: The computer and domain controller have mismatched passwords
- Time differences: Large time differences between computer and domain controller (Kerberos requires time sync within 5 minutes)
- Domain controller changes: The domain controller the computer was using is no longer available
- Extended offline periods: Computer was offline longer than 30 days (password expired)
- Domain controller migration: Old domain controller was removed without proper decommissioning
- Computer account issues: Account disabled, deleted, or corrupted in Active Directory
Solution 1: Reset Computer Account (Proper Fix)
The proper way to fix a broken trust relationship is to reset the computer account in Active Directory, then reconnect the computer to the domain. This re-establishes the secure channel.
Step 1: Reset Computer Account in Active Directory
On a domain controller or computer with RSAT tools installed:
- Open Active Directory Users and Computers
- Navigate to the Computers container (or the OU where the computer account is located)
- Right-click on the computer account
- Select Reset Account
- Click Yes to confirm
Alternatively, use PowerShell on a domain controller:
Reset-ComputerMachinePassword -Server YourDomainController -Credential (Get-Credential)
Or reset the specific computer account:
Get-ADComputer -Identity "ComputerName" | Reset-ADComputerMachinePassword
Step 2: Reconnect the Computer to Domain
On the affected computer, you have a few options:
Option A: Using System Properties
- Log in with a local administrator account (or cached domain credentials if available)
- Right-click This PC → Properties
- Click Change settings (or Advanced system settings)
- Click Change in the Computer Name tab
- Click OK (don't change anything, just confirm the domain membership)
- When prompted, enter domain administrator credentials
- Restart the computer when prompted
Option B: Using PowerShell (Run as Administrator)
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)
Enter domain administrator credentials when prompted. This command resets the secure channel without requiring a restart.
Option C: Using Command Prompt (Run as Administrator)
netdom reset ComputerName /Domain:YourDomain.com /UserD:Administrator /PasswordD:Password
Replace ComputerName with the computer name, YourDomain.com with your domain, and provide domain administrator credentials.
Solution 2: Remove and Rejoin Domain (Quick Fix)
If you can access the computer (with cached credentials or local admin), you can remove it from the domain and rejoin it. This is often faster than resetting the account.
Step 1: Remove from Domain
- Log in with a local administrator account
- Right-click This PC → Properties
- Click Change settings
- Click Change
- Select Workgroup and enter a workgroup name (e.g., "WORKGROUP")
- Click OK
- Enter local administrator credentials when prompted
- Restart the computer
Step 2: Rejoin Domain
- After restart, log in with the local administrator account
- Right-click This PC → Properties
- Click Change settings
- Click Change
- Select Domain and enter your domain name
- Click OK
- Enter domain administrator credentials when prompted
- Restart the computer when prompted
Note: You may need to delete the old computer account from Active Directory before rejoining, or the computer will rejoin with the same account automatically.
Solution 3: PowerShell Reset (Fastest Fix)
If you can access the computer with local administrator rights, PowerShell provides the quickest fix:
Using Test-ComputerSecureChannel with Repair
Open PowerShell as Administrator and run:
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)
Enter domain administrator credentials when prompted. This command:
- Tests the secure channel
- If broken, repairs it by resetting the machine password
- Doesn't require a restart
Using Reset-ComputerMachinePassword
Reset-ComputerMachinePassword -Server YourDomainController.domain.com -Credential (Get-Credential)
Replace YourDomainController.domain.com with your domain controller's FQDN. Enter domain administrator credentials when prompted.
Solution 4: Temporary Bypass (Quick Access)
If you need immediate access to the computer but can't fix the trust relationship right away, you can use temporary workarounds:
Option 1: Use Cached Credentials
If the user has logged into this computer before, cached credentials may still work:
- At the login screen, enter the domain username and password
- If it says "The trust relationship failed," try clicking "Switch user" or "Other user"
- Enter the credentials in format:
DOMAIN\Username - Cached credentials may allow login even with broken trust
Limitations: You may not be able to access network resources, but you can access the local computer and potentially fix the trust relationship.
Option 2: Use Local Administrator Account
If you know the local administrator password:
- At the login screen, click "Other user" or "Switch user"
- Enter:
.\Administrator(orComputerName\Administrator) - Enter the local administrator password
- You can now access the computer and fix the trust relationship
Option 3: Enable Local Administrator (If Disabled)
If local administrator is disabled and you can't access the computer:
- Boot from a Windows installation media or recovery environment
- Open Command Prompt (Shift+F10 during setup)
- Navigate to Windows system32:
cd /d C:\Windows\System32 - Rename utilman.exe:
ren utilman.exe utilman.exe.bak - Copy cmd.exe:
copy cmd.exe utilman.exe - Reboot and click the Ease of Access icon on login screen
- Command Prompt opens - enable local admin:
net user administrator /active:yes - Set password:
net user administrator NewPassword - Restore utilman.exe: Boot to recovery again and rename back
Warning: This is a security workaround. Restore utilman.exe after fixing the trust relationship.
Solution 5: Command Line Reset (netdom)
If you have RSAT tools or Remote Server Administration Tools installed, you can use netdom to reset the secure channel:
netdom reset ComputerName /Domain:YourDomain.com /UserD:DomainAdmin /PasswordD:Password
Or interactively (safer, doesn't expose password in command history):
netdom reset ComputerName /Domain:YourDomain.com /UserO:DomainAdmin
This will prompt for the password. After running, restart the computer.
Solution 6: Fix Time Synchronization Issues
If time differences are causing the trust relationship to fail:
- Check current time on the computer:
w32tm /query /status - Sync time with domain controller:
w32tm /resync /force - Verify time sync:
w32tm /query /status - If still broken, try resetting the secure channel using Solution 1 or 3
Time differences greater than 5 minutes will break Kerberos authentication and cause trust relationship failures.
Preventing Trust Relationship Issues
To prevent trust relationship issues from occurring:
- Keep computers connected: Ensure computers connect to the domain regularly (at least every 30 days)
- Configure time sync: Ensure computers sync time with domain controllers (usually automatic)
- Properly decommission DCs: When removing domain controllers, decommission them properly (see domain controller migration guide)
- Monitor for issues: Check event logs for authentication errors
- Don't delete computer accounts: Avoid manually deleting computer accounts in AD unless necessary
Which Solution Should You Use?
Choose based on your situation:
- Can access computer with local admin? Use Solution 3 (PowerShell) - fastest and cleanest
- Need immediate access? Use Solution 4 (temporary bypass) to get in, then fix properly
- Can't access computer? Reset computer account in AD (Solution 1, Step 1), then use Solution 4 to access and reconnect
- Want cleanest fix? Use Solution 1 (reset account + reconnect) - most thorough
- Time sync issues? Fix time first (Solution 6), then reset secure channel if needed
- Quick fix needed? Solution 2 (remove/rejoin) works but is more disruptive
Summary
Trust relationship issues are common but fixable. The proper fix is to reset the computer account in Active Directory and reconnect the computer, but PowerShell's Test-ComputerSecureChannel -Repair is often the fastest solution if you have local admin access. For immediate access when you can't fix right away, use cached credentials or local administrator accounts as a temporary workaround.
Always ensure proper time synchronization and keep computers connected to the domain regularly to prevent these issues. When domain controllers are migrated or decommissioned, always do so properly to avoid breaking trust relationships across the domain.
Need Help with This Process?
If you need help fixing trust relationship issues, or if this is out of your scope to complete, we're here to help. Contact us through our contact page at nhmohio.com and we'll be happy to assist with any project, including Active Directory issues, domain troubleshooting, and other infrastructure projects.