Skip to content
Home » Diagnosing Network Problems with PowerShell in Windows 11

Diagnosing Network Problems with PowerShell in Windows 11

Some useful PowerShell commands for network troubleshooting in Windows 11:

Get-NetIPConfiguration: This command allows you to view the current IP configuration of your network adapter. This is useful for identifying issues with your IP address, subnet mask, and default gateway.

# View the current IP configuration of your network adapter
Get-NetIPConfiguration

InterfaceAlias           : Ethernet
InterfaceIndex           : 12
InterfaceDescription     : Intel(R) Ethernet Connection (2) I219-LM
NetProfile.Name          : Home
NetProfile.IPv4Address   : 192.168.0.100
NetProfile.IPv4DefaultGateway : 192.168.0.1
NetProfile.IPv4Subnet    : 255.255.255.0
NetProfile.DNSServer     : 192.168.0.1
NetProfile.DNSSuffix     :
IPv4Address              : 192.168.0.100
IPv4Mask                 : 255.255.255.0
IPv4DefaultGateway       : 192.168.0.1
IPv4DNSServer            : 192.168.0.1

Test-NetConnection: This command allows you to test the connectivity of a remote host by performing a ping, traceroute, and TCP port test. This is useful for determining if there are any issues with network latency or connectivity.

# Test the connectivity of a remote host
Test-NetConnection -ComputerName example.com -Port 80

ComputerName           : example.com
RemoteAddress          : 93.184.216.34
RemotePort             : 80
InterfaceAlias         : Ethernet
SourceAddress          : 192.168.0.100
PingSucceeded          : True
PingReplyDetails (RTT) : 60 ms
TcpTestSucceeded       : True

Get-NetRoute: This command allows you to view the current routing table on your system. This is useful for identifying routing issues or for determining the path that network traffic will take.

# View the current routing table
Get-NetRoute

IfIndex DestinationPrefix    NextHop                                     RouteMetric
------- ---------------    ------                                     ----------
       11 ::/0              fe80::d11d:8a63:6a10:636b                           0
       12 ::/0              fe80::5ef5:79ff:fe00:c7be                           0
       12 fe80::/64         On-link                                             20
       11 fe80::/64         On-link                                             20
       12 ff00::/8          On-link                                             256
       11 ff00::/8          On-link                                             256
       12 192.168.0.0/24    On-link                                             276
       11 192.168.0.0/24    On-link                                             276

Get-NetAdapter: This command allows you to view information about the network adapters on your system, including the status, MAC address, and connection speed. This is useful for identifying issues with your network hardware.

# View information about the network adapters on your system
Get-NetAdapter

Name                     InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                     --------------------                    ------- ------       ----------             ---------
Ethernet                 Intel(R) Ethernet Connection (2) I219-LM      12 Up           00-15-5D-00-C7-BE      1 Gbps
Wi-Fi                    Intel(R) Wireless-AC 9560 160MHz            ... Up           D4-6A-6A-10-6C-6B      1.73 Gbps

Reset-NetAdapter: This command allows you to reset a network adapter, which can be useful for troubleshooting issues with connectivity or performance.

# Reset the "Ethernet" adapter
Reset-NetAdapter -Name "Ethernet"

Name                     InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                     --------------------                    ------- ------       ----------             ---------
Ethernet                 Intel(R) Ethernet Connection (2) I219-LM      12 Disconnected 00-15-5D-00-C7-BE      1 Gbps

Leave a Reply

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

17 − 8 =