A. Using the Active Directory Services Interface (ADSI) you can use a script like the following sample to query objects from AD--such as trustedDomain objects from a domain's system container--and thereby obtain a list of all the trusted domains.

Option Explicit
Dim objConnection, objChild
Set objConnection =
  objConnection.Filter = Array("trustedDomain")
For Each objChild In objConnection
  WScript.Echo objChild.Name
Wscript.Echo "Operation Completed"

Ensure that you replace the "Set objConnection" Lightweight Directory Access Protocol (LDAP) connection string with one for your domain. For example, if a domain controller (DC) is DC1 in domain savilltech.com, the line would read:

Set objConnection =