How can I display information on the desktop about whether the local server is a Global Catalog (GC)?
March 31, 2004
A. As I discussed in the FAQ "Q. How can I automatically display computer information on my desktop?", Sysinternals offers a free utility called BgInfo that displays configurable system information on your desktop wallpaper. To add information about the local server's GC status, perform the following steps:
Save the following VBScript code into a file called localgc.vbs:
On Error Resume NextSet WSHNetwork = CreateObject("WScript.Network")Set objRoot = GetObject("LDAP://"&WSHNetwork.ComputerName&"/RootDSE")objDSServiceDN = objRoot.Get("dsServiceName")Set objDSRoot = GetObject("LDAP://"&WSHNetwork.ComputerName&"/" & objDSServiceDN )blnCurrentOptions = objDSRoot.Get("options")If blnCurrentOptions ThenEcho "Yes"ElseEcho "No"End If
Start BgInfo (bginfo.exe).
Click the Custom button, then click New.
In the Identifier field, enter the identifier "Global Catalog". Then, under "Replace identifier with," select "VB Script file."
Click Browse, navigate to the location of the localgc.vbs file, then click Open.
Click OK to close the Define New Field dialog box.
Click OK to close the User Defined Fields dialog box.
Select "Global Catalog" from the Fields list, then click Add.
Now when you click OK to run BgInfo, the local server's GC status appears on the desktop with the other system information. You can also run the script locally (i.e., outside of BgInfo) by replacing the Echo commands in the script with WScript.Echo.
About the Author
You May Also Like