Trust Relationship: Sample Case V

Scenario
Given two domains - Domain1 and Domain2 you want to add Domain1 as a trusting (permitted to trust) domain on Domain2.

Assumptions
Domain2
is either the domain where the sample script will run or is a trusted domain of the current domain.

Procedure
Use the AddTrustingDomain method of IDomainTrustManagement interface to add Domain1 as a trusting domain on Domain2.

Script

Dim Trust As IDomainTrustManagement
Dim Password As String

'Get the interface.

Set Trust = GetObject ("NTDS://Domain2")

Password = InputBox ("Enter the password used while adding trusted domain", "")

 'Add domain1 as trusting domain of Domain2

Trust.AddTrustingDomain "Domain1", Password

 

 

See Also