PowerShell – List all domains in a forest

Some time ago I wrote a post about using PowerShell to get some basic information about your domain. But what if you’re in a multi-domain environment?
When you execute the following PowerShell one liner you will get a list of all domains in a forest:

[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() | select domains

2 comments

  1. fanaka says:

    i need find other domain trusted with this domain .. help me 🙁
    fa.kimo14@gmail.com

  2. Jeff Wouters says:

    Take a look at my AD Health Check.
    There I have a section for thrusts where get all thrusts and then filter on sync dates.
    Remove the filter and you should have the code you want: http://jeffwouters.nl/index.php/health-check

    Jeff.

Leave a Reply

Your email address will not be published. Required fields are marked *