# Domain Trusts and Forests Enumeration

## Trusts

### Get a List of All Trusts in the Current Domain

```powershell
Get-NetDomainTrust [-Domain <domain>] # PowerView
Get-ADTrust -Filter * [-Identity <domain>] # AD Module
```

* Using pywerview\.py

```bash
python pywerview.py get-netdomaintrust -w bizcorp.local -u <user> -p <pass> -t <dc> [-d <domain>] 
```

### Listing All Trusts in Another Forest (If Your Current Forest is in a Bi-Directional Trust With Another Forest)

```powershell
Get-NetForestDomain -Forest <forest> | Get-NetDomainTrust # PowerView
```

## Forest Mapping

### Get Details About the Current Forest

```powershell
Get-NetForest [-Forest <forest>] # PowerView
Get-ADForest [-Identity <forest>] # AD Module
```

### Get All Domains in the Current Forest

```powershell
Get-NetForestDomain [-Forest <forest>] # PowerView
(Get-ADForest).Domains # AD Module
```

### Get All Global Catalogs for the Current Forest

```powershell
Get-NetForestCatalog [-Forest <forest>] # PowerView
Get-ADForest | select -ExpandProperty GlobalCatalogs # AD Module
```

### Map Trusts of a Forest

```powershell
Get-NetForestTrust [-Forest <forest>] # PowerView
Get-ADTrust -Filter 'msDS-TrustForestTrustInfo -ne "$null"' # AD Module
```
