Page 1 of 1 1
Topic Options
#214058 - 2022-03-09 01:15 PM Real IP Address
HarrowCactus Offline
Fresh Scripter

Registered: 2006-04-12
Posts: 10
Loc: United Kingdom
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"

Top
#214059 - 2022-03-09 04:55 PM Re: Real IP Address [Re: HarrowCactus]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
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.

Top
#214060 - 2022-03-09 04:57 PM Re: Real IP Address [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
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

Top
#214061 - 2022-03-09 05:20 PM Re: Real IP Address [Re: ShaneEP]
HarrowCactus Offline
Fresh Scripter

Registered: 2006-04-12
Posts: 10
Loc: United Kingdom
Looks like that does not work in Windows 10, It errors out at line 104
Top
#214062 - 2022-03-10 06:04 AM Re: Real IP Address [Re: HarrowCactus]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
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.
_________________________
(... better days ahead)

Top
#214078 - 2022-04-14 01:55 AM Re: Real IP Address [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#214219 - 2023-04-21 02:41 AM Re: Real IP Address [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
FYI - my server and KixLib is back online at https://www.barnas.us/Downloads/Kixlib/index.htm
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1016 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org