> For the complete documentation index, see [llms.txt](https://otter.gitbook.io/red-teaming/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://otter.gitbook.io/red-teaming/notes/powershell/powershell-snippets/enumerate-domain-trusts.md).

# Enumerate Domain Trusts

This snippet enumerates standard information about domain trusts.

```powershell
# import PowerView
Import-Module ..\PowerView.ps1

# enumerate all domain trusts with the default LDAP method 
Get-DomainTrust

# enumerate all domain trusts w/ .NET methods
Get-DomainTrust -NET

# enumerate all domain trusts w/ API methods
Get-DomainTrust -API

# enumerate forest trusts
Get-ForestTrust

# enumerate trusts for domain.com
Get-DomainTrust -Domain domain.com

Get-DomainForeignUser
Get-DomainForeignGroupMember -Domain domain.com

Get-DomainForeignGroupMember -Domain anotherdomain.com | %{ $_ | Add-Member Noteproperty 'ResolvedSID' $(ConvertFrom-SID $_.MemberName); $_}
```

Reference:

* [Domain Trusts](/red-teaming/notes/powershell/interfacing-with-ad.md#domain-trusts)
