Finding Global Catalog servers in the forest

Global catalogs are domain controllers that also hold a subset of information on all objects in the forest. They are a required infrastructure component for Universal Groups and Exchange among other things.

            
"`nMicrosoft"            
Get-ADForest |             
select -ExpandProperty GlobalCatalogs |            
Format-Table            
            
"`nScript"            
$for = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()            
$for.FindAllGlobalCatalogs() |             
select Name, IPAddress |             
Format-table


Only two options for discovering them. The Microsoft cmdlets provide a Get-ADForest that returns an object representing the forest – it includes a collection of global catalog names



The Script uses System.DirectoryServices.ActiveDirectory.Forest and the GetCurrentForest() method to discover the forest object and the collection of global catalogs.



There doesn’t seem to be an easy way to do the job through the provider or the Quest cmdlets

Leave a Reply