Sample script that searches Active Directory for all the trust relationships in a domain.

PowerShell
Edit|Remove
$objDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() 
$objDomain.GetAllTrustRelationships() | Select-Object TargetName