Powershell – Get Network Adapter Information


# Gets the basic network adapter properties

PS C:\> get-netadapter

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Slot 3 Port 2             Intel(R) Ethernet Converged Networ...#3      10 Not Present  xx-xx-xx-xx-xx-xx          0 bps
Slot 5 Port 2             Intel(R) Ethernet Converged Network ...      11 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC TEAM                  Microsoft Network Adapter Multiplexo...       7 Up           xx-xx-xx-xx-xx-xx         2 Gbps
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      17 Up           xx-xx-xx-xx-xx-xx         1 Gbps
Slot 6 Port 1             Intel(R) Ethernet 10G 2P X550-t Adapter       5 Disconnected xx-xx-xx-xx-xx-xx          0 bps
NIC2                      Intel(R) Ethernet 10G X710 rNDC              13 Not Present  xx-xx-xx-xx-xx-xx          0 bps
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC #2        16 Up           xx-xx-xx-xx-xx-xx         1 Gbps
Public Primary            Intel(R) Gigabit 4P X710/I350 rNDC            9 Disconnected xx-xx-xx-xx-xx-xx          0 bps
ISCSI 10.100.0.151 S5P1     Intel(R) Ethernet Converged Networ...#2       3 Up           xx-xx-xx-xx-xx-xx        10 Gbps
ISCSI 10.101.0.151 S3P1     Intel(R) Ethernet Converged Network ...       6 Up           xx-xx-xx-xx-xx-xx        10 Gbps
NIC1                      Intel(R) Ethernet 10G 4P X710/I350 rNDC       4 Not Present  xx-xx-xx-xx-xx-xx          0 bps

# You can narrow it down to just the name

PS C:\> get-netadapter "NIC TEAM"

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
NIC TEAM                  Microsoft Network Adapter Multiplexo...       7 Up           xx-xx-xx-xx-xx-xx         2 Gbps

# Get all physical network adapters

PS C:\> get-netadapter -Name * -Physical

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      17 Up           xx-xx-xx-xx-xx-xx         1 Gbps
Slot 6 Port 1             Intel(R) Ethernet 10G 2P X550-t Adapter       5 Disconnected xx-xx-xx-xx-xx-xx          0 bps
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC #2        16 Up           xx-xx-xx-xx-xx-xx         1 Gbps
Public Primary            Intel(R) Gigabit 4P X710/I350 rNDC            9 Disconnected xx-xx-xx-xx-xx-xx          0 bps
ISCSI 10.100.0.151 S5P1     Intel(R) Ethernet Converged Networ...#2       3 Up         xx-xx-xx-xx-xx-xx        10 Gbps
ISCSI 10.101.0.151 S3P1     Intel(R) Ethernet Converged Network ...       6 Up         xx-xx-xx-xx-xx-xx        10 Gbps

You can also do this to a remote device which is really handy!

PS C:\> Get-NetAdapter -Name * -CimSession "cor-server1"

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Ethernet 3                XenServer PV Network Device #0                3 Up           xx-xx-xx-xx-xx-xx        1 Gbps


PS C:\> Get-NetAdapter -Name * -CimSession "cor-server1"

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed PSComputerName
----                      --------------------                    ------- ------       ----------             --------- --------------
Slot 3 Port 2             Intel(R) Ethernet Converged Networ...#3      10 Not Present  xx-xx-xx-xx-xx-xx          0 bps cor-server1
Slot 5 Port 2             Intel(R) Ethernet Converged Network ...      11 Not Present  xx-xx-xx-xx-xx-xx          0 bps cor-server1
NIC TEAM                  Microsoft Network Adapter Multiplexo...       7 Up           xx-xx-xx-xx-xx-xx         2 Gbps cor-server1
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      17 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Slot 6 Port 1             Intel(R) Ethernet 10G 2P X550-t Adapter       5 Disconnected xx-xx-xx-xx-xx-xx          0 bps cor-server1
NIC2                      Intel(R) Ethernet 10G X710 rNDC              13 Not Present  xx-xx-xx-xx-xx-xx          0 bps cor-server1
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC #2        16 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Public Primary            Intel(R) Gigabit 4P X710/I350 rNDC            9 Disconnected xx-xx-xx-xx-xx-xx          0 bps cor-server1
ISCSI 10.100.0.151 S5P1     Intel(R) Ethernet Converged Networ...#2       3 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
ISCSI 10.101.0.151 S3P1     Intel(R) Ethernet Converged Network ...       6 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
NIC1                      Intel(R) Ethernet 10G 4P X710/I350 rNDC       4 Not Present  xx-xx-xx-xx-xx-xx          0 bps cor-server1


PS C:\> Get-NetAdapter -Name * -Physical  -CimSession "cor-server1"

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed PSComputerName
----                      --------------------                    ------- ------       ----------             --------- --------------
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      17 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Slot 6 Port 1             Intel(R) Ethernet 10G 2P X550-t Adapter       5 Disconnected xx-xx-xx-xx-xx-xx          0 bps cor-server1
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC #2        16 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Public Primary            Intel(R) Gigabit 4P X710/I350 rNDC            9 Disconnected xx-xx-xx-xx-xx-xx          0 bps cor-server1
ISCSI 10.100.0.151 S5P1     Intel(R) Ethernet Converged Networ...#2       3 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
ISCSI 10.101.0.151 S3P1     Intel(R) Ethernet Converged Network ...       6 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1

And finally, you can see only the UP interfaces:

PS C:\> Get-NetAdapter -Name * -Physical  -CimSession "cor-server1" | where status -eq 'up'

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed PSComputerName
----                      --------------------                    ------- ------       ----------             --------- --------------
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      17 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC #2        16 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
ISCSI 10.100.0.151 S5P1     Intel(R) Ethernet Converged Networ...#2       3 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
ISCSI 10.101.0.151 S3P1     Intel(R) Ethernet Converged Network ...       6 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1


PS C:\> Get-NetAdapter -Name * -Physical  -CimSession "asil-claims1" | where status -eq 'up'

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed PSComputerName
----                      --------------------                    ------- ------       ----------             --------- --------------
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      23 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC           15 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Slot 3 Port 2             Intel(R) Ethernet Converged Networ...#2      27 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
Slot 5 Port 2             Intel(R) Ethernet Converged Network ...       4 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1


PS C:\> Get-NetAdapter -Name * -CimSession "asil-claims1" | where status -eq 'up'

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed PSComputerName
----                      --------------------                    ------- ------       ----------             --------- --------------
Slot 6 Port 2             Intel(R) Ethernet 10G 2P X550-t Ad...#2      23 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Public Secondary          Intel(R) Gigabit 4P X710/I350 rNDC           15 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1
Slot 3 Port 2             Intel(R) Ethernet Converged Networ...#2      27 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
Slot 5 Port 2             Intel(R) Ethernet Converged Network ...       4 Up           xx-xx-xx-xx-xx-xx        10 Gbps cor-server1
TEAM1                     Microsoft Network Adapter Multiplexo...      16 Up           xx-xx-xx-xx-xx-xx         1 Gbps cor-server1