Fix 'File Already Exists' Error When Creating a Two-Way Trust Between Domain Controllers
Question details
The user needs to establish a two-way trust relationship between two primary domain controllers but is blocked by a file existence error.

- Product
- Windows Server Active Directory
- Device & OS
- not provided
- Scenario
- Attempting to create a two-way trust relationship between two distinct Active Directory domains to allow cross-domain resource access.
- Observed behavior
- The setup process fails, displaying an error message that indicates 'the file already exists', preventing the trust from being successfully created.
Ensure you have Enterprise Admin or Domain Admin privileges in both domains, and always create a system state backup of your Active Directory before making structural changes.
Clear Stale Active Directory Trust Objects
Use this solution to remove remnants of previous, failed, or improperly removed trust relationships that trigger the 'file already exists' conflict.
When a trust relationship is deleted improperly or a previous setup attempt fails, hidden Trusted Domain Objects (TDOs) can be left behind in the Active Directory System partition. These remnants conflict with new trust configurations.
Log into your Primary Domain Controller, open 'Active Directory Domains and Trusts' from the Administrative Tools, and check if any broken trust relationships are currently listed. If they are, right-click and remove them.
If no trust is visible in the GUI, open 'ADSI Edit' (adsiedit.msc). Connect to the 'Default naming context' and expand your domain.
Navigate to 'CN=System'. Look for objects of type 'trustedDomain' that match the name of the domain you are trying to trust.
Carefully delete these orphaned 'trustedDomain' objects. Repeat this process on the Primary Domain Controller of the other domain, then restart the Netlogon service on both servers.

Verify DNS Resolution and Connectivity
Ensure that both domain controllers can properly locate and communicate with each other over the network before attempting to establish a trust.
Document Your Server Configurations with WPS Office
While resolving Active Directory trust issues requires native Windows Server tools, IT professionals need a reliable suite for maintaining system documentation, network diagrams, and server logs. WPS Office offers a lightweight, robust, and free alternative to standard office software.

Frequently Asked Questions
Which firewall ports must be open to establish a two-way domain trust?
To successfully establish and maintain a domain trust, you must allow traffic over DNS (TCP/UDP 53), Kerberos (TCP/UDP 88), RPC Endpoint Mapper (TCP 135), RPC Dynamic Ports (TCP 49152-65535), LDAP (TCP/UDP 389), and SMB (TCP 445) between both domain controllers.
Why does the system say a trust file already exists when I cannot see one in the GUI?
This typically occurs if a previous trust was forcefully or improperly removed. The graphical interface may no longer display the trust, but the underlying Trusted Domain Object (TDO) still exists hidden within the Active Directory 'System' container.
Can I create a two-way trust if the domain controllers cannot ping each other by name?
No, successful DNS name resolution is a strict prerequisite for Active Directory trusts. You must configure conditional forwarders or stub zones in your DNS settings so both domains can resolve each other's Fully Qualified Domain Names (FQDN) before running the trust wizard.




