Not show all IP Addresses with BGInfo

Hello Experts,

I am testing BGInfo with some of our servers. We will deploy it via GPO.

We have web servers having multiple IP Address. In BGInfo (or with a WMI query) is there a way to only show 1 IP address and not all IP addresses?

The problem is if we show all the IP Addresses of our webservers, the BGInfo information will be shifted (see example in attachment).

Janio Andre GutierrezSystem AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

☠ MASQ ☠Commented:
Try using the Custom option in BGInfo for the IP identifier string.
Choose WMI Query and put
SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=True

Open in new window

in the path box

That should limit BGInfo to displaying only the active IP address
Janio Andre GutierrezSystem AdministratorAuthor Commented:
Already put this WMI query. The additional IP addresses are added directly to the same network card so with this query, since
there is only one network card, BGInfo will display all the IP addresses.
☠ MASQ ☠Commented:
AH, my misunderstanding I thought you had multiple NICs

Interesting problem
Have just grabbed this WMI Script from a Google search  but looks like it's going in the right direction.  Try:
strComputer = "."
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")

For Each objIP in colSettings
   For i=LBound(objIP.IPAddress) to UBound(objIP.IPAddress)
     If InStr(objIP.IPAddress(i),":") = 0 Then Echo objIP.IPAddress(i) : WScript.Quit

Open in new window

in the same way.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Janio Andre GutierrezSystem AdministratorAuthor Commented:
I try it but receive this error each time i want to put the VBScript in BGInfo (see attachment). Do you know what is it ?
☠ MASQ ☠Commented:
A shot of the Debug screen would be more useful, is it possible to post that?
Janio Andre GutierrezSystem AdministratorAuthor Commented:
Yes, this is what i get when i click on debug
☠ MASQ ☠Commented:
BGInfo 4.22 doesn't seem to handle VBS scripts properly
Try v 4.16
I managed to find a clean copy of the 32bit version here
~But it's not an official site.
Janio Andre GutierrezSystem AdministratorAuthor Commented:

I try the script with BGInfo v 4.16 and it seem to work but i get no data.
☠ MASQ ☠Commented:
You’ve added the new field to the black BGInfo panel and then edited its properties with the path to the .vbs?
Janio Andre GutierrezSystem AdministratorAuthor Commented:
Yes i added and appear nothing. Only appear the field but without result.
☠ MASQ ☠Commented:
Strange. I‘ve installed to a test machine with multiple IPs and the script shows the first and last address in the range.
Janio Andre GutierrezSystem AdministratorAuthor Commented:
Yes it is working now !!

The only problem with BGInfo 4.16 is if we put the OS field, it is showing Windows NT 6.2 for a Windows 2012 R2.
☠ MASQ ☠Commented:
Would it just be better to hide the OS field?  How many users would actually benefit from knowing their OS - or if they need to tell somebody that person would know what NT 6.2 represents?

Alternatively put another script in to replace the default field

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    Wscript.Echo objOperatingSystem.Caption & "  " & objOperatingSystem.Version

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.