โ† Windows & Intune
๐Ÿ”‘ Active Directory

Ways to Fix Active Directory Trust Relationship Issues

Diagnose and fix broken AD trust relationships โ€” from secure channel failures to machine account resets and domain rejoin procedures.

โ„น๏ธ
Typical error: "The trust relationship between this workstation and the primary domain failed." This means the machine account password is out of sync with the domain controller.
Confirm the Trust Issue
Test-ComputerSecureChannel -Verbose

If this returns False, the secure channel is broken and needs to be repaired.


Repair Secure Channel (No Rejoin Needed)

The quickest fix โ€” reset the machine account password without removing the device from the domain.

# Run as Domain Admin on the affected machine:
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

# Or using netdom:
netdom resetpwd /server:<DC-name> /userd:DOMAIN\Administrator /passwordd:*

Rejoin the Domain

If the secure channel repair doesn't work, remove and rejoin the domain. Log in with a local admin account first.

# Remove from domain (use local admin creds):
Remove-Computer -WorkgroupName WORKGROUP -Restart -Force

# After reboot, rejoin:
Add-Computer -DomainName "yourdomain.com" `
  -Credential (Get-Credential) `
  -OUPath "OU=Computers,DC=yourdomain,DC=com" `
  -Restart

Reset Machine Account from DC

If you can't log on at all, reset the machine account from a Domain Controller, then force a password sync.

# On the Domain Controller (run as Domain Admin):
Reset-ComputerMachinePassword -Server <DC-name> -Credential (Get-Credential)

# Or via ADUC:
# Active Directory Users and Computers โ†’ find computer โ†’ right-click โ†’ Reset Account