question

YaroC-2432 avatar image
0 Votes"
YaroC-2432 asked RichMatheisen-8856 commented

list network adapters of given type

I'm trying to count how many NICs of a different type are installed in servers I'm overlooking (mostly 2012R2 and 2016). I tried using both get-netadapter and gwmi win32_networkadapter class but neither will present adapters which are teamed and so giving incorrect count. Is the any other method to list all installed NICs disregarding teaming?

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered RichMatheisen-8856 commented

If WMI can't do it then maybe Get-NetLbfoTeam, Get-NetLbfoTeamNic, and Get-NetLbfoTeamMember (or a combination those cmdlets) can? Combine the results with Get-NetAdaptor and you may be able to get the number of NICs.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

No, that won't help as we're dealing with multiple types of bonding not only Windows teaming. I was hoping there is some function that can return all network adapters regardless of teaming technology used.

0 Votes 0 ·
YaroC-2432 avatar image
0 Votes"
YaroC-2432 answered RichMatheisen-8856 commented

Nope, it still lists teamed adapters as a single adapter of custom name without any reference actual physical adapters.
It get's even more interesting. I was trying to simply get the network mask of the teamed adapter and I can't seem to find a commandlet that will get me that. I can get IP address, gateway , even DNS servers yet network mask is just not listed anywhere other than by running ipconfig.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If you look at the Device Manager GUI do you see separate NICs for the team? If you do then I think there's a way . . . I just don't know what it is! It might be a WMI or CIM class to enumerate the physical devices by naming the slots the NICs are plugged into.

0 Votes 0 ·
YaroC-2432 avatar image
0 Votes"
YaroC-2432 answered RichMatheisen-8856 commented

Yes, I was wondering the same. All NICs are visible in Device Manager and Network and Sharing Center yet when they're teamed it seems the system doesn't recognize them as individual adapters anymore.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It'd probably be a good idea to ask the manufacturer of the NICs that aren't using Windows teaming how to accomplish this. They may have a command-line tool, or a WMI class.

0 Votes 0 ·