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.

Get-ADForest |             
select -ExpandProperty GlobalCatalogs |            
$for = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()            
$for.FindAllGlobalCatalogs() |             
select Name, IPAddress |             

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

This entry was posted in PowerShell and Active Directory. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s