Enumerates trust relationships
strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & _strComputer & "\root\MicrosoftActiveDirectory")Set colTrustList = objWMIService.ExecQuery _("Select * from Microsoft_DomainTrustStatus")For each objTrust in colTrustListWscript.Echo "Trusted domain: " & objTrust.TrustedDomainWscript.Echo "Trust direction: " & objTrust.TrustDirectionWscript.Echo "Trust type: " & objTrust.TrustTypeWscript.Echo "Trust attributes: " & objTrust.TrustAttributesWscript.Echo "Trusted domain controller name: " & objTrust.TrustedDCNameWscript.Echo "Trust status: " & objTrust.TrustStatusWscript.Echo "Trust is OK: " & objTrust.TrustIsOKNext
This is a VB Script, this can be used by saving the file in .vbs file