Multiple results for IP and Mac Address

(imported topic written by mallika91)

Hi All,

We are using the following querry for IP and Mac address, it shows multiple results for most of computers.But we need all the IP assigned.

please modify the following query for getting multiple answers on the console.

IP:

addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (loopback of it = false) of network

Mac address:

mac addresses of adapters of network

Thanks

Mallikarjun

(imported comment written by mallika91)

Hi All,

We are using the following querry for IP and Mac address, it shows multiple results for most of computers.But we need all the IP assigned.

please modify the following query for getting multiple answers on the console.

IP:

addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (loopback of it = false) of network

Thanks

Mallikarjun

(imported comment written by arnaud91)

Hi Mallikarjun,

Not sure I fully understood what you are trying to accomplish. The following query will retrieve all mac addresses and the associated ip address:

Q: (address of it as string, mac address of it as string) of adapters whose (address of it as string != “0.0.0.0” and exists address of it) of network

A: 192.168.1.21, 00-21-5c-7d-79-2d

A: 192.168.30.1, 00-50-56-c0-00-01

A: 192.168.79.1, 00-50-56-c0-00-08

If you want to concatenate all ip addresses, you can use the following:

Q: concatenation " - " of (addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (loopback of it = false) of network as string)

A: 192.168.30.1 - 192.168.1.21 - 192.168.79.1

Arnaud

(imported comment written by gjeremia91)

You already are getting multiples. If you are looking for them as a single string then just concatenate them together:

concatenation “,” of (addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (loopback of it = false) of network as string)

or even

concatenation “, " of ( (address of it as string & " (” & mac address of it & “)”) of adapters whose (address of it as string != “0.0.0.0”) of network )

(imported comment written by anthonymap91)

This works great for Windows OS, how about UNIX?

Thanks

(imported comment written by SystemAdmin)

For Unix servers, gjeremia’s first example works fine. The second example, though, needs a very slight change. You need to replace ‘adapters’ with ‘ip interfaces’. i.e.

concatenation “, " of ( (address of it as string & " (” & mac address of it & “)”) of ip interfaces whose (loopback of it = false) of network as string)