Trusts

Domain Trust Mapping

Get a list of all domain trusts for the current domain

Get-DomainTrust
Get-DomainTrust -Domain us.dollarcorp.moneycorp.local

Get-ADTrust
Get-ADTrust -Identity us.dollarcorp.moneycorp.local

Forest mapping

  • Get details of current forest

Get-Forest
Get-Forest -Forest eurocorp.local

Get-ADForest
Get-ADForest -Identity eurocorp.local
  • Get all domains in the current forest

Get-ForestDomain -Verbose
Get-ForestDomain -Forest eurocorp.local

(Get-ADForest).Domains 
  • Get all global catalogs for current forest

Get-ForestGlobalCatalog
Get-ForestGlobalCatalog -Forest eurocorp.local

Get-ADForest | select -ExpandProperty GlobalCatalogs
  • Map Trusts of a Forest

Get-ForestTrust
Get-ForestTrust -Forest eurocorp.local

Get-ADTrust -Filter 'msDS-TrustForestTrustInfo -ne "$null"'
  • List only External Trusts in the current forest

Get-ForestDomain | %{Get-DomainTrust -Domain $_.Name} | ?{$_.TrustAttributes -eq "FILTER_SIDS"}
  • List external trusts of another domain

Get-DomainTrust | ?{$_.TrustAttributes -eq "FILTER_SIDS"}

Last updated