So here is a twist (for which I can take
no credit)…If you have the Microsoft Shell (Monad) installed….
(Can be installed on a workstation - http://www.microsoft.com/downloads/details.aspx?FamilyID=ec1d82d9-0aff-451a-88b4-41db70e04f19&displaylang=en)
To get the GCs in the forest, issue the
following two commands in the Microsoft Shell:
$MyForest =
[System.DirectoryServices.ActiveDirectory.Forest]::getcurrentForest()
$MyForest.GlobalCatalogs
The result is something like:
Forest
: MyForest.us
CurrentTime
: 11/30/2005 8:05:58 PM
HighestCommittedUsn : 3444285
OSVersion
: Windows Server 2003
Roles
: {SchemaRole, NamingRole, PdcRole}
Domain :
sacnet.us
IPAddress
: 10.1.0.1
SiteName
: MySite1
SyncFromAllServersCallback :
InboundConnections :
{035ddf44-5838-4a24-bb44-8b3c35a90140}
OutboundConnections :
{6cb45330-5ab3-49f6-9ad5-321c80896c10}
Name :
MyGC1.MyForest.us
Partitions :
{DC=MyForest,DC=us, CN=Configuration,DC=MyForest,DC=us,
CN=Schema,CN=Configuration,DC=MyForest,DC=us, DC=DomainDnsZones,DC=MyForest,DC=us,
DC=ForestDnsZones,DC=MyForest,DC=us}
Forest :
MyForest.us
CurrentTime :
11/30/2005 8:05:58 PM
HighestCommittedUsn : 2794469
OSVersion
: Windows Server 2003
Roles
: {RidRole, InfrastructureRole}
Domain
: MyForest.us
IPAddress
: 10.2.0.2
SiteName
: MySite2
SyncFromAllServersCallback :
InboundConnections :
{6cb45330-5ab3-49f6-9ad5-321c80896c10}
OutboundConnections :
{035ddf44-5838-4a24-bb44-8b3c35a90140}
Name
: MyGC2.MyForest.us
Partitions
: {DC=MyForest,DC=us, CN=Configuration,DC= MyForest,DC=us,
CN=Schema,CN=Configuration,DC= MyForest,DC=us, DC=DomainDnsZones,DC= MyForest,DC=us,
DC=ForestDnsZones,DC= MyForest,DC=us}
From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx on behalf of Harding, Devon
Sent: Tue 11/29/2005 10:43 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: [ActiveDir] GC list
What’s the easiest way to get a list of ALL my
DC’s and GC’s in my forest along with IP address?
Devon Harding
Windows Systems Engineer
Southern Wine & Spirits
- BSG
954-602-2469