If you have NOT already installed the Windows Server Support Tools on you workstation, install them from the \SUPPORT\TOOLS\SUPTOOLS.MSI file of the Windows Server CD-ROM.
Using NETDOM.EXE and Repadmin.exe from the Support Tools, I have scripted ListGC.bat to list the global catalog servers in the domain you are logged onto.
The syntax for using ListGC.bat is:
@echo off setlocal set get=netdom QUERY /DOMAIN:%USERDNSDOMAIN% DC set no=The command completed successfully. for /f "Skip=1 Tokens=*" %%a in ('%get%^|find /V "%no%"') do ( call :isgc %%a ) endlocal goto :EOF :isgc set GC=N for /f "Tokens=*" %%g in ('repadmin /showreps %1 ^|findstr /l /i /C:"DC Options: IS_GC"') do ( set GC=Y ) if "%GC%" EQU "Y" @echo %1