Scenario
Given two domains - Domain1 and
Domain2- you want to create a trust
relationship between Domain1 and
Domain2 - that is, you want to add
Domain2 as a trusted domain of
Domain1.
Assumptions
Domain1 is the trusted domain of the domain where the sample script will run.
The user under whose context this script will run has administrative rights on Domain2.
Procedure
Use the EstablishTrust method of
IDomainTrustManagement to create the
required trust relationship in one single operation.
Script
Dim Trust As IDomainTrustManagement
'Get the interface.
Set Trust = GetObject ("NTDS://Domain1")
'Establish trust relationship with Domain2
Trust.EstablishTrust "Domain2", ONE_WAY_TRUST
See Also