Is there a way to return all the forests on your network? I need to be able get the collection of forests and then then get all domains on each forest for some automation that I am trying to write.
Appreciate the assistance.
PS C:\Windows> ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() ).GetAllTrustRelationships()
PS C:\Windows> ([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).GetAllTrustRelationships()