Skip navigation

How can I display information on the desktop about whether the local server is a Global Catalog (GC)?

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:

  1. Save the following VBScript code into a file called localgc.vbs:
    On Error Resume Next
    
    Set 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 Then
    Echo "Yes"
    Else
    Echo "No"
    End If 
  2. Start BgInfo (bginfo.exe).
  3. Click the Custom button, then click New.
  4. In the Identifier field, enter the identifier "Global Catalog". Then, under "Replace identifier with," select "VB Script file."
  5. Click Browse, navigate to the location of the localgc.vbs file, then click Open.
  6. Click OK to close the Define New Field dialog box.
  7. Click OK to close the User Defined Fields dialog box.
  8. 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.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish