Author: gachurch
Subject: IPv4 address only
Posted: 08 February 2018 at 6:12pm
Subject: IPv4 address only
Posted: 08 February 2018 at 6:12pm
Hi rpelletier,
Yes, we ran into the same issue and I was able to find VB script by someone called "WindowsStart". It's working fine for us on BGINFO v4.16. It only shows the active IP address. Here's the code you can copy to a txt file and then resave as a .vbs file. Create a new custom bginfo config file if you dont already have one. Then create a new "User Defined Field" and call it " IP ADDRESSES" and select "VB Script File" and point to the path of the .vbs file you created and put in your BGINFO install folder. Once done just add the new "IP addresses" field to your view and test... NOTE: you cant call it "IP ADDRESS"(singular) because it already exists as a default value in BGINFO. Hope this helps... here's the code...
' Special BGInfo Script
' Only IPv4 Address v1.7
' Programmed by WindowsStar - Copyright (c) 2009-2011
' --------------------------------------------------------
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)
Next
Next
' Only IPv4 Address v1.7
' Programmed by WindowsStar - Copyright (c) 2009-2011
' --------------------------------------------------------
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)
Next
Next