> For the complete documentation index, see [llms.txt](https://wiki.bufu-sec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.bufu-sec.com/active-directory/enumeration/forest_mappings.md).

# Forest Mappings

## Get Details about the Current Forest

```powershell
# AD Module
Get-ADForest
Get-ADForest -Identity lab.local

# PowerView
Get-NetForest
Get-NetForest -Forest lab.local
```

## Get All Domains in the Current Forest

```powershell
# AD Module
(Get-ADForest).Domains

# PowerView
Get-NetForestDomain
Get-NetForestDomain -Forest lab.local
```

## Get All Global Catalogs for the Current Forest

```powershell
# AD Module
Get-ADForest | Select -ExpandProperty GlobalCatalogs

# PowerView
Get-NetForestCatalog
Get-NetForestCatalog -Forest lab.local
```

## Map Trusts of a Forest

```powershell
# AD Module
Get-ADTrust -Filter 'msDS-TrustForestTrustInfo -ne "$null"'

# PowerView
Get-NetForestTrust
Get-NetForestTrust -Forest lab.local
```

## Map All Trusts in Current Forest

```powershell
# PowerView
Get-NetForestDomain |  Get-NetDomainTrust
```
