With BGInfo, from SysInternals, you can display various system configuration values on screen, such as the computer name, IP address, operating system version etc. What if you want to display values from other sources, like the registry or from WMI or even from your own custom script?

BGInfo is flexible enough to get/set this values for you with a few mouse clicks. For example, on our servers I wanted to add the server model and Serial number.

This is the main BGInfo window. You can edit which items to show, just delete the lines you don’t need. To add new items, highlight the item you want in the ‘Fields’ select box and click the Add button.

 

 

To add WMI properties, click the ‘Custom’ button. In the next dialog click ‘New’:

 

You can see that BGInfo has more options to offer, other than WMI or Registry values. To add the SerialNumber WMI property, type a descriptive name in ‘Identifier’ text box and click the WMI Query radio button, then click browse. It can take some time for BGInfo to load all the WMI classes but it’s worth while because the next dialog is actually a WMI browser!

  

 

Find your class and the property you want and that’s it, pretty cool!

 

Here I’ve added two properties from different classes, the Model and SerialNumber properties.

 

Now, locate the new created properties in the ‘Fields’ select box and double click each one to add it. I made a few more adjustments to the main dialog (separating the properties with the equal characters).

 

 

Click the ‘Preview’ button to see the end result on your screen. Finally, you can place a shortcut to BGInfo in the startup folder so that it runs every boot/logon, or even configure it to display as the background for the logon screen. For more information see the ‘Installation and Use’ section in the help file.

 

-----------------------------
@ECHO OFF
TITLE BGInfo refresh on logon
SETLOCAL

C:\BGInfo\BgInfo.exe /iC:\BGInfo\BGInfo_Config.bgi /timer:0 /nolicprompt

EXIT

------------------------------

The BGInfo_Config.bgi file then uses one of the fields; created in the Custom option to display the IP address.  When configuring the BGInfo_Config.bgi file I selected the Custom button to add/edit the user defined fields.  Here I have created the Identifier as Active IP, the Type is WMI Query and the path is SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'

When you have entered the path you can click on the Browse button which will open the WMI Query Selection box and then when you click on the Evaluate button, the Query Result(s) displays what the output will look like.  In this case it displays it as 192.168.1.69 fe80::31c2:3a45:11a1:1496

I just want to display the IPV4 address only, dropping the IPV6 address altogether.

Just as an FYI, In addition to the default Fields in BGInfo this is the full list of all the custom variables I use, depending on the OS and what the machine is built for:

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



From all this my layout on the machine desktop ends up like this (nicely spaced and in line, not crappy as it displays on this forum page Wink :

There is an apparent issue with BGinfo, everyones favorite sys internals tool for physical Server 2008 R2 boxes. This issue is that no network information shows up for IP, DNS, Gateway, and Subnet. I haven’t tested this issue with non-teamed NICs.



A way I found to fix this issue is by adding custom WMI query’s to the NICs for IP, DNS, Gateway, and Subnet separately. Feel free to name the identifier to whatever you want. I stuck with the same name as their default just with “New” at the end to differentiate them. Also, each manufacturer of the NIC will have a different “Index” number. To find out your specific “Index” number, run a WMI query with just“SELECT IPAddress FROM WIN32_NetworkAdapterConfiguration”. You’ll find a list of “(null)” values with one of the values actually listing the IP info. Start from the first value being 2, working down.

Just run a query with the below values, save and add them.

Custom IP Address –> SELECT IPAddress FROM WIN32_NetworkAdapterConfiguration WHERE Index = “<your index #>”

Custom DNS Address –> SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration WHERE Index = “<your index #>”

Custom Gateway –> SELECT DefaultIPGateway FROM Win32_NetworkAdapterConfiguration WHERE Index = “<your index #>”

Custom Subnet –> SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration WHERE Index = “<your index #>”