Use PowerShell to get some basic information about your domain and forest

Often I need to get some basic information about the domain and/or the forest of a customer where I’m troubleshooting an issue.
Of course you could simply logon to a domain controller and check it over there. But what if that’s not possible, for example a customers that values there security won’t provide “some consultant” access to their domain controller.

With the following command you can get some basic information about your current domain:
[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
image

And for the domain, the same command can be used with a minor adjustment:
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
image

The commands mentioned above can be executed on any domain member…

Leave a Reply

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