Friday, November 9, 2012

BGInfo Useful Custom Strings

Recently I have been using BGInfo a bit more to get a better handle on what servers I am currently working on. Most of the time the standard definitions work well enough, but there are the few occasions when I want to show additional details or to hide information.

One such case that has come up often is when a server has multiple NICs, but only one is in use. BGInfo by default show all, so you have to add custom WMI queries to show only the info you want. I found a site that listed several useful queries as follows:

  • Active DNS - WMI Query - SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active IP - WMI Query - SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active MAC Address - WMI Query - SELECT MACAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active Subnet Mask - WMI Query - SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Manufacturer - WMI Query - SELECT Manufacturer FROM Win32_ComputerSystem
  • Model - WMI Query - SELECT Model FROM Win32_ComputerSystem
  • OS and Edition - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName
  • OS Architecture - WMI Query - SELECT OSArchitecture FROM Win32_OperatingSystem
  • OS Architecture XP2K3 - Registry Value - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE
  • Workgroup - WMI Query - SELECT Workgroup FROM Win32_ComputerSystem

I also added one of my own to show the IIS version on the desktop:
  • IIS Version - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\SetupString
Using these in combination with the predefined queries has allowed me to display all relevant information that I want.