Enumerating Domain Trusts & Forest Trusts
PowerView
Get list of all domain trusts for the current domain
Get-NetDomainTrustGet list of all domain trusts for another domain
Get-NetDomainTrust -Domain <DOMAIN NAME>Get details about the current forest
Get-NetForestGet details about another forest
Get-NetForest -Forest <FOREST NAME>Get all domains in the current forest
Get-NetForestDomainGet all domains in another forest
Get-NetForestDomain -Forest <FOREST NAME>Get all Global Catalogs for the current forest
Get-NetForestCatalogGet all Global Catalogs for another forest
Get-NetForestCatalog -Forest <FOREST NAME>Get list of forest trusts for the current forest (Excludes external trust)
Get-NetForestTrustGet list of forest trusts for the another forest
Get-NetForestTrust -Forest <FOREST NAME>Get mapping of trusts and direction from current domain
Get-NetForestDomain | Get-NetDomainTrustGet mapping of trusts and direction from another domain
Get-NetForestDomain -Forest <FOREST NAME> | Get-NetDomainTrustGet the external forest trusts only
Get-NetForestDomain -Verbose | Get-NetDomainTrust | ?{$_.TrustType -eq 'External'}Get the external domain trusts only
Get-NetDomainTrust | ?{$_.TrustType -eq 'External'}Active Directory Module
Get list of all domain trusts for the current domain
Get-ADTrust -Filter *Get list of all domain trusts for another domain
Get-ADTrust -Filter * -Identity <DOMAIN NAME>Get details about the current forest
Get-ADForestGet details about another forest
Get-ADForest -Identity <FOREST NAME>Get all domains in the current forest
(Get-ADForest).DomainsGet all domains in another forest
(Get-ADForest -Identity <FOREST NAME> ).DomainsGet all Global Catalogs for the current forest
Get-ADForest | Select -ExpandProperty GlobalCatalogsGet all Global Catalogs for another forest
Get-ADForest -Identity <FOREST NAME> | Select -ExpandProperty GlobalCatalogsGet mapping of trusts and direction from current domain
Get-ADTrust -Filter * | Select Name,Direction,ForestTransitive,IntraForest,IsTreeParent,IsTreeRoot | ftGet mapping of trusts and direction from another domain
Get-ADTrust -Filter * -Server <DOMAIN NAME> | Select Name,Direction,ForestTransitive,IntraForest,IsTreeParent,IsTreeRoot | ftGet the external domain trusts only from current domain
(Get-ADForest).Domains | %{Get-ADTrust -Filter '(intraForest -ne $True) -and (ForestTransitive -ne $True)' -Server $_}
Get-ADTrust -Filter '(intraForest -ne $True) -and (ForestTransitive -ne $True)'Get the external domain trusts only from another domain
(Get-ADForest -Server <DOMAIN NAME> ).Domains | %{Get-ADTrust -Filter '(intraForest -ne $True) -and (ForestTransitive -ne $True)' -Server $_}Last updated