Setup a 2-way trust between 2 Active Directory Forests/Domains (2024)

This blog describes setting up a trust between two domains/forests. In this blog, I used Microsoft Windows Server 2022. A prerequisite to making the 2-way trust work is enabling the necessary firewall ports between the domain controllers.

Check the links below to which network ports are needed for the 2-way trust.
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/config-firewall-for-ad-domains-and-trusts

The following tasks need to be executed:

  • Setup DNS Conditional Forwarders
  • Verify connectivity between the Domain Controllers
  • Create the trust

Scenario:

  • One Domain Controller (Forest name and Domain name domainA.lan)
  • One Domain Controller (Forest name and Domain name domainB.lan)
  • Domain Controller in domainA.lan domain has the following information:
    FQDN :srv-ms-dc01.domainA.lan
    IP:192.168.41.10
  • Domain Controller in domainB.lan domain has the following information:
    FQDN:srv-ms-dc02.domainB.lan
    IP:192.168.41.50
  • Created on both domains a service account with the same password

Note: The domain names in the screenshot differ from those used in the blog.

Setup DNS Conditional Forwarders

This part describes how to create the DNS Conditional Forwarders with PowerShell or through the GUI.

Create DNS Conditional Forwarders with PowerShell


On the Domain Controller in domainA open PowerShell with Administrative rights and execute the following command.

Add-DnsServerConditionalForwarderZone -Name <domain name B> -MasterServers <IP Address DC in domainB>
Setup a 2-way trust between 2 Active Directory Forests/Domains (1)

On the Domain Controller in domainB open PowerShell with Administrative rights and execute the following command:

Add-DnsServerConditionalForwarderZone -Name <domain name A> -MasterServers <IP Address DC in domainA>
Setup a 2-way trust between 2 Active Directory Forests/Domains (2)

The next step is verifying if the DNS Conditional Forwarders resolve the addresses.

Open the Domain Controller in DomainA DNS Manager Snapin from the Administrative Tools. Expand the Conditional Forwarders.

Setup a 2-way trust between 2 Active Directory Forests/Domains (3)

Right-click the Domain Name and select Properties.

Setup a 2-way trust between 2 Active Directory Forests/Domains (4)

Select Edit from the screenshot below.

Setup a 2-way trust between 2 Active Directory Forests/Domains (5)

When the validation shows OK the Conditional Forwarder is working correctly.

Setup a 2-way trust between 2 Active Directory Forests/Domains (6)

Execute this test also on the Domain Controller of domainB.

Setup a 2-way trust between 2 Active Directory Forests/Domains (7)

When both Conditional Forwarders are correctly validated, we continue with the Trust.

Create DNS Conditional Forwarders through the GUI

Open the DNS Manager on both Domain Controllers in both Domains.

Right-click on the Conditional Forwarders and select New Conditional Forwarder.

Setup a 2-way trust between 2 Active Directory Forests/Domains (8)

Enter the domain name (DomainB.lan) and enter the IP Address of the Domain Controller in domainB.

Select the option Store this conditional forwarder in Active Directory, and replicate it as follows. Leave the configuration All DNS servers in this forest as it is.

Setup a 2-way trust between 2 Active Directory Forests/Domains (9)

Select OK to store the newly created Conditional Forwarder. The validation is not executed yet.

The new conditional forwarder is created. Right-click the domain name and select Properties.

Setup a 2-way trust between 2 Active Directory Forests/Domains (10)
Setup a 2-way trust between 2 Active Directory Forests/Domains (11)

The new created conditional forwarder opens and select Edit.

Setup a 2-way trust between 2 Active Directory Forests/Domains (12)

If the validation is correct the validation shows OK.

Setup a 2-way trust between 2 Active Directory Forests/Domains (13)

Execute the same steps on the Domain Controller in domainB.

Setup a 2-way trust between 2 Active Directory Forests/Domains (14)

Use the name of domainA and enter the IP Address of the Domain Controller of domainA. Multiple IP Addresses of Domain Controllers could be added.

Setup a 2-way trust between 2 Active Directory Forests/Domains (15)

After the creation of the conditional forwarder re-open to check if the validation is succeeded.

Setup a 2-way trust between 2 Active Directory Forests/Domains (16)

The Conditional Forwarders are now created on both domains.

Create the two-way trust between the Forest/Domain

The next step is creating the two-way trust between the 2 forests/domains.

Create the two-way trust with PowerShell

Netdom cannot be used to create a forest trust between two AD DS Forests. To create a cross-forest trust between two AD DS Forests use the script below.

Source: http://technet.microsoft.com/en-us/library/cc835085%28v=ws.10%29.aspx

The option CreateTrustRelationShip can hold 3 options:

  • Bidirectional
  • Inbound
  • Outbound

Because we are creating a two-way trust the option should be Bidirectional.

Script:

# Change following parameters$strRemoteForest = "<domainB>"$strRemoteAdmin = "domainB\<username>"$strRemoteAdminPassword = "<password>$remoteContext = New-Object -TypeName "System.DirectoryServices.ActiveDirectory.DirectoryContext" -ArgumentList @( "Forest", $strRemoteForest, $strRemoteAdmin, $strRemoteAdminPassword)try { $remoteForest = [System.DirectoryServices.ActiveDirectory.Forest]::getForest($remoteContext) #Write-Host "GetRemoteForest: Succeeded for domain $($remoteForest)" }catch { Write-Warning "GetRemoteForest: Failed:`n`tError: $($($_.Exception).Message)" }Write-Host "Connected to Remote forest: $($remoteForest.Name)"$localforest=[System.DirectoryServices.ActiveDirectory.Forest]::getCurrentForest()Write-Host "Connected to Local forest: $($localforest.Name)"try { $localForest.CreateTrustRelationship($remoteForest,"Bidirectional") Write-Host "CreateTrustRelationship: Succeeded for domain $($remoteForest)" }catch { Write-Warning "CreateTrustRelationship: Failed for domain $($remoteForest)`n`tError: $($($_.Exception).Message)" } 

Open the Active Directory Domains and Trusts on the Domain Controller in domainA. Right-click the domain name and select properties.

Setup a 2-way trust between 2 Active Directory Forests/Domains (17)

Select the tab Trusts and check if domainB is added in the Outgoing and Incoming trust. Check this also on the Domain Controller in domainB.

Setup a 2-way trust between 2 Active Directory Forests/Domains (18)
Setup a 2-way trust between 2 Active Directory Forests/Domains (19)

If both Domain Controllers show the Trust the two-way trust is successfully created.

Create the two-way trust through the GUI

Open the Active Directory Domains and Trusts Snap-in from the Administrative Tools on the Domain Controller in domainA.

Setup a 2-way trust between 2 Active Directory Forests/Domains (20)

Right-click the domain name and select Properties.

Setup a 2-way trust between 2 Active Directory Forests/Domains (21)

Select the tab Trusts.

Setup a 2-way trust between 2 Active Directory Forests/Domains (22)

Select New Trust.

Select Next in the Welcome window.

Setup a 2-way trust between 2 Active Directory Forests/Domains (23)

Enter the domainB name in the field and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (24)

Select Forest trust and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (25)

Select Two-way and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (26)

Select Both this domain and the specified domain and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (27)

Enter the credentials of an admin account from domainB and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (28)

Select Forest-wide authentication and select Next to continue. Execute this twice.

Setup a 2-way trust between 2 Active Directory Forests/Domains (29)

Select Next in the Trust Selections Complete window.

Setup a 2-way trust between 2 Active Directory Forests/Domains (30)

Select Next in the Trust Creation Complete window.

Setup a 2-way trust between 2 Active Directory Forests/Domains (31)

Select Yes, confirm the outgoing trust and select Next to continue.

Setup a 2-way trust between 2 Active Directory Forests/Domains (32)

Execute this also for the Incoming Trust.

Setup a 2-way trust between 2 Active Directory Forests/Domains (33)

Select Finish to finalize the two-trust configuration.

Setup a 2-way trust between 2 Active Directory Forests/Domains (34)

Check on both Domain Controllers in the Active Directory Domains and Trusts Snap-in if the trust is created on both Incoming and Outgoing.

Setup a 2-way trust between 2 Active Directory Forests/Domains (35)
Setup a 2-way trust between 2 Active Directory Forests/Domains (36)
Setup a 2-way trust between 2 Active Directory Forests/Domains (2024)
Top Articles
Kiedy opłaty za gaz Ethereum są najniższe? Poradnik
World Homelessness Day 2024 - Backpack Bed for Homeless Australia
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6104

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.