HarrowCactus
(Fresh Scripter)
2022-03-09 01:15 PM
Real IP Address

Wonder if anyone can help, With Windows 10 and Hyper-V virtual machines, a machine can have multiple virtual network cards, is there a way in Kix to find the actual in use adapter, as @IPADDRESS0 is just returning the 1st adaptor in the list, which is normally has a 172 address

Each Virtual machine has its own Virtual Ethernet card, so some of or machines have over 5 Virtual cards and one physical. If I do a ipconfig /all, all the devices are start with "Hyper-V Virtual Ethernet Adapter"


ShaneEP
(MM club member)
2022-03-09 04:55 PM
Re: Real IP Address

Have you tried using @IPADDRESS1, @IPADDRESS2, @IPADDRESS3?

The manual says you can only get 0-3, so not sure if you try more than that. I don't have anything with more than one adapter to test on.


ShaneEP
(MM club member)
2022-03-09 04:57 PM
Re: Real IP Address

Also, after a quick glance at the UDF list, looks like Glenn posted a function that could help called NICInfo().

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=150839#Post150839


HarrowCactus
(Fresh Scripter)
2022-03-09 05:20 PM
Re: Real IP Address

Looks like that does not work in Windows 10, It errors out at line 104

AllenAdministrator
(KiX Supporter)
2022-03-10 06:04 AM
Re: Real IP Address

Below is two UDFs that do basically the same thing as Glenn's UDF does, it just gets the data differently.

EnmumNetworkConnections - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=139601#Post139601
GetIPOptions - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=159170#Post159170

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

The second example in GetIPOptions() header should be a very good start to get you going. I'd also be interested in what line 104 is in your code that you had the error. Glenn doesn't generally post buggy UDFs.


Glenn BarnasAdministrator
(KiX Supporter)
2022-04-14 01:55 AM
Re: Real IP Address

I know we're using that function across tens of thousands of computers in a daily audit tool. The new version (1.5) was only available from my website, which has been offline since I moved and the power in my new computer room won't be installed until early May 2022..

I updated the NICInfo() UDF in the original post that Shane referenced. Scroll to the bottom of the post to grab the working version.

Glenn


Glenn BarnasAdministrator
(KiX Supporter)
2023-04-21 02:41 AM
Re: Real IP Address

FYI - my server and KixLib is back online at https://www.barnas.us/Downloads/Kixlib/index.htm