Friday, July 02, 2010

How to find an Active Directory forest?

I have not found any good ways to determine what forest a domain is part of. By default the first domain you created becomes the root of the forest, but often you need to know for sure wha the forest is, even if the name is not often used.

On Windows 2008 R2 I can open the Active Directory Domains and Trusts application and right-click the top node – there I can choose to change forest. And then display the name of the forest I am part of.

Image from Domains and Trusts

But if you do not have a Windows 2008 R2 server, you need to so some scripting. Save the lines below to a file called getroot.vbs and execute the file.

Set o = CreateObject("ADSystemInfo")
Wscript.Echo "Forest DNS Name: " & o.ForestDNSName

Source: http://www.windowsitpro.com/article/domains2/how-can-i-determine-which-domain-is-the-forest-root-domain-.aspx

Technorati Tags:

Labels:

1 Comments:

At 18:20, Anonymous Van Vangor said...

Thanks for posting that little gem! That's just what I needed!

See Ya!
Van

 

Post a Comment

Links to this post:

Create a Link

<< Home