Given a Domain Controller (DC), domain account with appropriate permissions, and a domain workstation with Remote Server Administration Tools (RSAT) and PowerShell available.
Operator Note: Identifying and reviewing domain trust relationships helps detect unexpected or unauthorized domain connections, which could be used for lateral movement or privilege escalation.
All Domain Trust relationship information has been exported to a local file and validated for review by the incident response team.
The Active Directory Domain Services (AD DS) Cmdlets are available on:
Import-Module ActiveDirectory
Get-WmiObject -Class Microsoft_DomainTrustStatus -Namespace ROOT\MicrosoftActiveDirectory |
Select-Object PSComputername, TrustedDomain, TrustAttributes, TrustDirection, TrustType |
Format-List
1
= Non-Transitive2
= Transitive1
= Incoming Only2
= Outgoing Only3
= Two-wayGet-WmiObject -Class Microsoft_DomainTrustStatus -Namespace ROOT\MicrosoftActiveDirectory |
Select-Object PSComputername, TrustedDomain, TrustAttributes, TrustDirection, TrustType |
Export-Csv ".\DomainTrusts.csv" -NoTypeInformation
nltest /domain_trusts
Operator Note:
nltest
provides trust relationships including flags that indicate transitive and direct/indirect relationships.
Import-Module .\PowerView.ps1
Get-DomainTrust
Operator Note: PowerView provides advanced trust relationship analysis but should only be used if authorized.
Example script (PowerShell):
Get-WmiObject -Class Microsoft_DomainTrustStatus -Namespace ROOT\MicrosoftActiveDirectory |
Export-Csv .\DomainTrusts.csv -NoTypeInformation
Save the exported file to a secure incident response working directory.
Tool | Platform | Use Case |
---|---|---|
PowerShell (WMI) | Windows | Primary trusted relationship export |
nltest | Windows | Quick command-line trust verification |
PowerView | Windows | Advanced trust and domain relationship analysis |
Active Directory Domains and Trusts GUI | Windows | Visual review of trusts (no export feature) |
AD DS Cmdlets
Get-DomainTrusts (PowerView)
NLTEST Trusts Documentation
Date | Version | Description | Author |
---|---|---|---|
2025-05-02 | 1.9 | Full original + enriched PowerShell, alternate tooling, operator checklist and best practices | Leo |