Some Useful Windows Networking Commands

# Checking WinRM connections
PS C:\Windows\system32> netstat -ano|select-string ":5985"
  TCP    0.0.0.0:5985           0.0.0.0:0              LISTENING       4
  TCP    192.11.0.7:5985        192.12.128.106:63603   SYN_RECEIVED    4  ==> indicates normal working status from within the OS
  TCP    192.11.0.7:5985        192.13.64.44:51589     SYN_RECEIVED    4

# Search MAC table on localhost
$macAddress="xx:xx:xx:xx:xx:xx"
arp -a | findstr $macAddress

# Checking network configs
PS C:\Windows\system32> Get-NetIPConfiguration
InterfaceAlias       : Ethernet 2
InterfaceIndex       : 3
InterfaceDescription : Microsoft Hyper-V Network Adapter #2
NetProfile.Name      : kimconnect.com
IPv4Address          : 192.12.134.21
IPv6DefaultGateway   :
IPv4DefaultGateway   : 192.12.134.1
DNSServer            : 192.12.130.100
                       192.12.130.101
# List adapters
PS C:\Windows\system32> Get-NetAdapter
Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
NIC2                      Broadcom NetXtreme Gigabit Ethernet #2       29 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC4                      Broadcom NetXtreme Gigabit Ethernet #4       26 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC Team1 - TESTLAB...     Microsoft Network Adapter Multiple...#4      25 Up           xx-xx-xx-xx-xx-xx        40 Gbps
NIC Team1                 Microsoft Network Adapter Multiplexo...      23 Up           xx-xx-xx-xx-xx-xx        40 Gbps
Ethernet 5                Intel(R) Ethernet Converged Networ...#2      21 Up           xx-xx-xx-xx-xx-xx        40 Gbps
Ethernet 4                Intel(R) Ethernet Converged Network ...      15 Up           xx-xx-xx-xx-xx-xx        40 Gbps
NIC3                      Broadcom NetXtreme Gigabit Ethernet          13 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC1                      Broadcom NetXtreme Gigabit Ethernet #3       11 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC Team1 - TESTLAB...     Microsoft Network Adapter Multiple...#2       8 Up           xx-xx-xx-xx-xx-xx        40 Gbps
Ethernet 2                Remote NDIS Compatible Device                 5 Not Present  xx-xx-xx-xx-xx-xx          0 bps
NIC Team1 - TESTLAB...     Microsoft Network Adapter Multiple...#3       4 Up           xx-xx-xx-xx-xx-xx        40 Gbps

# List Physical adapters
PS C:\Windows\system32> Get-NetAdapter -Physical
Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Ethernet 5                Intel(R) Ethernet Converged Networ...#2      21 Up           xx-xx-xx-xx-xx-xx        40 Gbps
Ethernet 4                Intel(R) Ethernet Converged Network ...      15 Up           xx-xx-xx-xx-xx-xx        40 Gbps

# Get advanced properties of a NIC
$nicName="Ethernet 2"
Get-NetAdapter -Name $nicName | Get-NetAdapterAdvancedProperty

PS C:\Windows\system32> Get-NetAdapter -Name $nicName | Get-NetAdapterAdvancedProperty
Name                      DisplayName                    DisplayValue                   RegistryKeyword RegistryValue
----                      -----------                    ------------                   --------------- -------------
Ethernet 2                IPv4 Checksum Offload          Rx & Tx Enabled                *IPChecksumO... {3}
Ethernet 2                IPSec Offload                  Auth Header and ESP Enabled    *IPsecOffloadV2 {3}
Ethernet 2                Jumbo Packet                   Disabled                       *JumboPacket    {1514}
Ethernet 2                Large Send Offload Version ... Enabled                        *LsoV2IPv4      {1}
Ethernet 2                Large Send Offload Version ... Enabled                        *LsoV2IPv6      {1}
Ethernet 2                Max Number of RSS Processors   16 Processors                  *MaxRssProce... {16}
Ethernet 2                Network Direct (RDMA)          Disabled                       *NetworkDirect  {0}
Ethernet 2                Maximum Number of RSS Queues   16 Queues                      *NumRssQueues   {16}
Ethernet 2                Packet Direct                  Disabled                       *PacketDirect   {0}
Ethernet 2                Recv Segment Coalescing (IPv4) Enabled                        *RscIPv4        {1}
Ethernet 2                Recv Segment Coalescing (IPv6) Enabled                        *RscIPv6        {1}
Ethernet 2                Receive Side Scaling           Enabled                        *RSS            {1}
Ethernet 2                RSS Base Processor Number      0                              *RssBaseProc... {0}
Ethernet 2                Maximum RSS Processor Number   15                             *RssMaxProcN... {15}
Ethernet 2                RSS Profile                    NUMA Scaling Static            *RSSProfile     {4}
Ethernet 2                TCP Checksum Offload (IPv4)    Rx & Tx Enabled                *TCPChecksum... {3}
Ethernet 2                TCP Checksum Offload (IPv6)    Rx & Tx Enabled                *TCPChecksum... {3}
Ethernet 2                UDP Checksum Offload (IPv4)    Rx & Tx Enabled                *UDPChecksum... {3}
Ethernet 2                UDP Checksum Offload (IPv6)    Rx & Tx Enabled                *UDPChecksum... {3}
Ethernet 2                Forwarding Optimization        Disabled                       ForwardingOp... {0}
Ethernet 2                Hyper-V Network Adapter Name                                  HyperVNetwor... {--}
Ethernet 2                Network Address                --                             NetworkAddress  {--}
Ethernet 2                Receive Buffer Size            8MB                            ReceiveBuffe... {8192}
Ethernet 2                Send Buffer Size               1MB                            SendBufferSize  {1024}
Ethernet 2                VLAN ID                        0                              VlanID          {0}

PS C:\Windows\system32> get-netadapter -name 'NIC Team1 - VLAN101' | Get-NetAdapterAdvancedProperty
DisplayName                    DisplayValue                   RegistryKeyword RegistryValue
----                      -----------                    ------------                   --------------- -------------
NIC Team1 - HyperV...0001 Encapsulated Task Offload      Enabled                        *Encapsulate... {1}
NIC Team1 - HyperV...0001 Header Data Split              Enabled                        *HeaderDataS... {1}
NIC Team1 - HyperV...0001 IPv4 Checksum Offload          Rx & Tx Enabled                *IPChecksumO... {3}
NIC Team1 - HyperV...0001 IPsec Offload                  Auth Header & ESP Enabled      *IPsecOffloadV2 {3}
NIC Team1 - HyperV...0001 Large Send Offload Version ... Enabled                        *LsoV2IPv4      {1}
NIC Team1 - HyperV...0001 Large Send Offload Version ... Enabled                        *LsoV2IPv6      {1}
NIC Team1 - HyperV...0001 Recv Segment Coalescing (IPv4) Enabled                        *RscIPv4        {1}
NIC Team1 - HyperV...0001 Recv Segment Coalescing (IPv6) Enabled                        *RscIPv6        {1}
NIC Team1 - HyperV...0001 Receive Side Scaling           Enabled                        *RSS            {1}
NIC Team1 - HyperV...0001 TCP Checksum Offload (IPv4)    Rx & Tx Enabled                *TCPChecksum... {3}
NIC Team1 - HyperV...0001 TCP Checksum Offload (IPv6)    Rx & Tx Enabled                *TCPChecksum... {3}
NIC Team1 - HyperV...0001 UDP Checksum Offload (IPv4)    Rx & Tx Enabled                *UDPChecksum... {3}
NIC Team1 - HyperV...0001 UDP Checksum Offload (IPv6)    Rx & Tx Enabled                *UDPChecksum... {3}
NIC Team1 - HyperV...0001 Virtual Machine Queues         Enabled                        *VMQ            {1}
NIC Team1 - HyperV...0001 Virtual Machine Queues - Sh... Enabled                        *VMQLookahea... {1}
NIC Team1 - HyperV...0001 Virtual Machine Queues - VL... Enabled                        *VMQVlanFilt... {1}
NIC Team1 - HyperV...0001 MAC Address                    --                             NetworkAddress  {--}

# Check hardware information
PS C:\Windows\system32> Get-NetAdapterHardwareInfo
Name                           Segment Bus Device Function Slot NumaNode PcieLinkSpeed PcieLinkWidth Version
----                           ------- --- ------ -------- ---- -------- ------------- ------------- -------
NIC0                                 0   1      0        2             0      5.0 GT/s             8 1.1
NIC1                                 0   1      0        1             0      5.0 GT/s             8 1.1
NIC2                                 0   1      0        0             0      5.0 GT/s             8 1.1
NIC3                                 0   1      0        3             0      5.0 GT/s             8 1.1

# Set Mac address of an adapter
$macAddress2="xx-xx-xx-xx-xx-xx"
Set-NetAdapter -Name "vEthernet" -MacAddress $macAddress2

Leave a Reply

Your email address will not be published. Required fields are marked *