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.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.