How can I determine which domain is the forest root domain?
January 13, 2004
A. Determining which domain is the forest root domain isn't simple in all cases. In a forest with one tree, the domain at the top of the tree namespace is the tree root. However, if your forest has multiple trees, determining which tree root is the forest root isn't so easy--no simple GUI view can give you this information. However, you can identify the forest root by performing either of the following series of steps on a machine that's a member of the forest:
Start Notepad and copy the following commands into the application:
Set objSysInfo = CreateObject("ADSystemInfo")Wscript.Echo "Forest DNS Name: " & objSysInfo.ForestDNSName
Save the file as forestroot1.vbs.
Exit Notepad, then double-click forestroot1.vbs in Windows Explorer.
Windows will display the DNS name of the forest root.
Or
Start Notepad and copy the following commands into the application:
Set objRootDSE = GetObject("LDAP://RootDSE")Wscript.Echo "Root Domain: " & objRootDSE.Get("RootDomainNamingContext")
Save the file as forestroot2.vbs.
Exit Notepad, then double-click forestroot2.vbs in Windows Explorer.
Windows will display the distinguished name (DN) of the forest root.
Because both files are VBScript files, you can also use Cscript to run them from the command line. For example, when I type
cscript forestroot1.vbs
my computer returns the following information:
Microsoft (R) Windows Script Host Version 5.6Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.Forest DNS Name: savilltech.com
Likewise, when I type
cscript forestroot2.vbs
my computer returns the following information:
Microsoft (R) Windows Script Host Version 5.6Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.Root Domain: DC=savilltech,DC=com
A.
About the Author
You May Also Like