You want to determine if a domain controller is a global catalog server. After you initially enable the global catalog on a domain controller, it can take some time for all of the read-only naming contexts to replicate to it, depending on how large your forest is.
Query the isGlobalCatalogReady attribute on the RootDSE for the domain controller. A TRUE value means the server is a global catalog and a FALSE value indicates it is not.
For more information on how to query the RootDSE, see Recipe 4.1.
Once a server has completed initial replication of the global catalog, the isGlobalCatalogReady attribute in the RootDSE will be marked TRUE. Another way to determine if a domain controller has been at least flagged to become a global catalog is by checking if the options attribute on the nTDSDSA object for the server has been set to 1. Note that this does not necessarily mean the server is accepting requests as a global catalog. An additional query to the RootDSE as described in the Solution, or directly to port 3268 (the global catalog port) could confirm it.
3.18.4 See Also
Recipe 4.1 for viewing the RootDSE