When you need quick information about your network and TCP/IP configuration, what's your go-to move? If you're still reaching for ipconfig, netsh, or ping in the old command prompt, you're not alone—but you're also missing out on something much more powerful.
PowerShell has evolved from "just a blue shell" (as one Reddit user hilariously admitted) into one of the most versatile network troubleshooting and automation tools available to Windows administrators. And here's the thing: Microsoft has been quietly phasing out legacy commands like netsh for years, nudging IT professionals toward PowerShell's object-oriented approach to network management.
If you've been putting off learning PowerShell networking commands, this is your wake-up call. Let's explore why PowerShell should be your primary tool for network diagnostics, configuration, and troubleshooting.
The command line has always been the hallmark of "real IT professionals." Linux advocates have long looked down on "click-happy" Windows users who supposedly could only navigate their systems through graphical interfaces. But as with most quasi-religious tech disputes, there were truths on both sides: traditional shell commands were often cumbersome for normal users, while Windows professionals envied the flexibility and programmability of Linux shell scripts, especially when automating network and system admin tasks.
Microsoft responded by giving Windows systems a mature shell consisting of a command-line interpreter and an extensive, object-oriented scripting language. With each new Windows version and server update—Exchange, SQL Server, and beyond—new cmdlets were added to PowerShell's arsenal.
Here's what makes PowerShell different: Instead of parsing text output like traditional commands, PowerShell cmdlets return objects you can manipulate, filter, and pipe to other commands. This means less time wrestling with grep patterns and more time actually solving problems.
Before diving into specific commands, let's see what's available. Open PowerShell (as Administrator for best results) and run:
Get-Module -ListAvailable
This command displays all available modules on your system. You'll notice many labeled with "Net"—these are your network-focused modules containing cmdlets for managing network adapters, IP addresses, routing tables, and TCP/IP configuration.
To see which commands are available within a specific module, try:
Get-Command -Module NetTCPIP
This reveals the full suite of networking cmdlets at your disposal. On modern Windows 10, Windows 11, and Windows Server systems, you'll find hundreds of network-related commands ready to use.
System administrators traditionally use ipconfig to view IP address information—and yes, you can still run ipconfig directly from the PowerShell command line. But there's a better way.
The Get-NetIPAddress cmdlet provides comprehensive information about both IPv4 and IPv6 addresses for all network adapters in your system:
Get-NetIPAddress
On a server system with multiple network cards, this displays extensive information. If you're overwhelmed by the output, pipe it through the Format-Table cmdlet for a cleaner view:
Get-NetIPAddress | Format-Table
Need only IPv4 addresses? Filter the output using the -AddressFamily parameter:
Get-NetIPAddress -AddressFamily IPv4 | Format-Table
Pro tip from Reddit: One systems engineer shared, "PowerShell has incredible diagnostic and network maintenance features. When all else fails, PowerShell can get the job done." This is especially true when you need to automate IP address checks across multiple servers or export configuration data for documentation.
Want to see all network interfaces installed on your computer? The Get-NetAdapter cmdlet displays detailed information about each adapter:
Get-NetAdapter
You can easily filter this output further. For example, to list only active Ethernet adapters:
Get-NetAdapter | Where-Object {$_.Status -eq "Up" -and $_.InterfaceDescription -like "*Ethernet*"}
This becomes incredibly useful when troubleshooting connectivity issues or verifying that specific network adapters are functioning correctly. You can also combine Get-NetAdapter with other cmdlets to gather comprehensive network configuration details:
Get-NetAdapter | Get-NetIPAddress | Format-Table
If you need to restart a network adapter (perhaps after configuration changes), use the Restart-NetAdapter cmdlet:
Restart-NetAdapter -Name "Ethernet"
While ping still works in PowerShell, the Test-Connection cmdlet offers much more flexibility and returns objects you can manipulate:
Test-Connection -ComputerName google.com -Count 4
This performs a standard ping test, but because it returns objects, you can easily filter, sort, or export the results. For instance, to test multiple hosts and only show successful connections:
Test-Connection -ComputerName server1, server2, server3 | Where-Object {$_.StatusCode -eq 0}
For more advanced network diagnostics, Test-NetConnection is your best friend. As one Reddit user explained: "I use this when a User/Vendor says their app can't connect. It does a ping and tests the TCP port. No need to install telnet on a user's machine or server."
Test-NetConnection -ComputerName blog.paessler.com -Port 443
This command tests both ICMP connectivity and whether a specific TCP port (in this case, HTTPS port 443) is accessible. The output includes:
Real-world scenario: When troubleshooting application connectivity issues, Test-NetConnection quickly identifies whether the problem is basic network connectivity or a specific service/port issue. This saves countless hours of back-and-forth with vendors who insist "it's not our application."
DNS issues are among the most common network problems. The Resolve-DnsName cmdlet replaces nslookup with a more powerful, scriptable alternative:
Resolve-DnsName -Name blog.paessler.com
This returns DNS records for the specified hostname. You can specify record types for more targeted queries:
Resolve-DnsName -Name paessler.com -Type MX
To query a specific DNS server (useful when troubleshooting DNS server issues):
Resolve-DnsName -Name blog.paessler.com -Server 8.8.8.8
You can also set or modify DNS server addresses using Set-DnsClientServerAddress:
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("8.8.8.8","8.8.4.4")
Understanding your routing table is critical for troubleshooting connectivity issues, especially in complex network environments with multiple subnets or VPN connections. The Get-NetRoute cmdlet displays your system's routing table:
Get-NetRoute | Format-Table
To view only IPv4 routes:
Get-NetRoute -AddressFamily IPv4 | Format-Table DestinationPrefix, NextHop, RouteMetric, ifIndex
This shows where traffic is being directed and helps identify routing problems that might cause connectivity failures or suboptimal network paths.
When you need to see active TCP connections (similar to netstat), use Get-NetTCPConnection:
Get-NetTCPConnection
To see only established connections:
Get-NetTCPConnection | Where-Object {$_.State -eq "Established"}
This is invaluable for security monitoring, identifying which applications are communicating over the network, and troubleshooting connection issues.
For systems using DHCP, you can release and renew IP addresses using PowerShell cmdlets. While it's "not as simple as using ipconfig" (as one Reddit user noted), it's far more powerful for scripting and automation:
# Release DHCP lease
(Get-WmiObject Win32_NetworkAdapterConfiguration).ReleaseDHCPLease()
# Renew DHCP lease
(Get-WmiObject Win32_NetworkAdapterConfiguration).RenewDHCPLease()
For administrators managing Windows DHCP servers, PowerShell provides comprehensive cmdlets for monitoring and configuring DHCP services, including scope management, lease tracking, and server health checks.
A user reports they can't access an internal web application. Here's your PowerShell troubleshooting workflow:
# Step 1: Verify IP configuration
Get-NetIPAddress -AddressFamily IPv4 | Format-Table
# Step 2: Test basic connectivity to the server
Test-Connection -ComputerName webserver.internal.local
# Step 3: Test the specific application port
Test-NetConnection -ComputerName webserver.internal.local -Port 80
# Step 4: Verify DNS resolution
Resolve-DnsName -Name webserver.internal.local
# Step 5: Check the default gateway
Get-NetRoute -AddressFamily IPv4 | Where-Object {$_.DestinationPrefix -eq "0.0.0.0/0"}
This systematic approach quickly identifies whether the issue is IP configuration, basic connectivity, the application service itself, DNS resolution, or routing.
When users complain about slow network performance, gather baseline data:
# Test connection quality with multiple pings
Test-Connection -ComputerName fileserver.local -Count 100 | Measure-Object -Property ResponseTime -Average -Maximum -Minimum
# Check for packet loss
$results = Test-Connection -ComputerName fileserver.local -Count 100
$loss = ($results | Where-Object {$_.StatusCode -ne 0}).Count
Write-Host "Packet loss: $($loss)%"
# Verify network adapter status
Get-NetAdapter | Where-Object {$_.Status -eq "Up"} | Format-Table Name, LinkSpeed, MediaType
This data helps you determine whether performance issues are network-related or caused by other factors like server load or application problems.
For comprehensive network performance monitoring beyond manual PowerShell commands, consider implementing continuous monitoring with PRTG Network Monitor, which can track bandwidth utilization, packet loss, and latency across your entire infrastructure automatically.
The real power of PowerShell networking commands emerges when you combine them into scripts for automation. Here's a simple network health check script:
# Network Health Check Script
$servers = @("dc01.local", "fileserver.local", "webserver.local")
foreach ($server in $servers) {
$result = Test-NetConnection -ComputerName $server -WarningAction SilentlyContinue
if ($result.PingSucceeded) {
Write-Host "$server is reachable" -ForegroundColor Green
} else {
Write-Host "$server is UNREACHABLE" -ForegroundColor Red
}
}
You can expand this to check specific ports, log results to a file, send email alerts, or integrate with monitoring systems. This is where PowerShell truly shines—transforming repetitive manual tasks into automated, consistent processes.
For more advanced network automation scenarios, including IP address management with PowerShell cmdlets, you can leverage built-in Windows Server features alongside custom scripts.
| Traditional Command | PowerShell Equivalent | Key Advantage |
|---|---|---|
ipconfig |
Get-NetIPAddress |
Object output, easier filtering |
ipconfig /all |
Get-NetIPConfiguration |
Comprehensive configuration in structured format |
ping |
Test-Connection |
Scriptable, returns objects |
tracert |
Test-NetConnection -TraceRoute |
Integrated with other diagnostics |
nslookup |
Resolve-DnsName |
More query options, better output |
netstat |
Get-NetTCPConnection |
Powerful filtering capabilities |
route print |
Get-NetRoute |
Easy to parse and manipulate |
arp -a |
Get-NetNeighbor |
Object-based neighbor cache |
While PowerShell networking commands are incredibly powerful for troubleshooting and one-time tasks, they're not a replacement for continuous network monitoring. Running manual commands only shows you a snapshot of your network at a specific moment.
For proactive network management, you need continuous visibility into:
This is where comprehensive network troubleshooting tools and monitoring solutions become essential. They provide the historical context and real-time alerting that manual PowerShell commands can't deliver.
Modern network monitoring platforms can also analyze network traffic patterns using SNMP, NetFlow, and packet capture—giving you insights that would take hours to gather manually with PowerShell.
Many network-related cmdlets require elevated privileges. Always run PowerShell as Administrator when performing network diagnostics or configuration changes.
PowerShell's tab completion is your friend. Type Get-Net and press Tab to cycle through available cmdlets. After typing a parameter dash (-), press Tab to see available parameters.
The pipeline (|) is PowerShell's superpower. Chain commands together to filter, sort, and format output exactly how you need it:
Get-NetAdapter | Where-Object {$_.Status -eq "Up"} | Select-Object Name, LinkSpeed | Sort-Object LinkSpeed -Descending
Export PowerShell results to CSV for documentation or analysis:
Get-NetIPAddress | Export-Csv -Path "C:\NetworkConfig.csv" -NoTypeInformation
Many PowerShell cmdlets support -WhatIf parameter, which shows what would happen without actually making changes:
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses "8.8.8.8" -WhatIf
Get-NetIPConfiguration provides similar output to ipconfig /all, while Get-NetIPAddress focuses specifically on IP addresses. Both return structured objects instead of text, making them more powerful for scripting and automation.
Use Test-Connection for basic ping tests and Test-NetConnection for advanced diagnostics including port testing. Combine these with Resolve-DnsName for DNS checks and Get-NetRoute for routing analysis to systematically identify connectivity issues.
Absolutely. PowerShell excels at automation. You can script network adapter configuration, DNS settings, IP address assignment, and virtually any network-related task. This is particularly valuable for deploying consistent configurations across multiple servers or workstations.
Traditional tools like ipconfig and ping return text output that's difficult to parse programmatically. PowerShell cmdlets return objects with properties and methods you can manipulate, filter, and pipe to other commands. This makes PowerShell far more powerful for automation and complex workflows.
PowerShell networking commands represent a fundamental shift in how Windows administrators manage and troubleshoot networks. While the learning curve might seem steep if you're accustomed to traditional command-line tools, the investment pays dividends in automation capabilities, troubleshooting efficiency, and scriptability.
Start by replacing your most common ipconfig, ping, and nslookup commands with their PowerShell equivalents. As you become comfortable with basic cmdlets, explore the pipeline, filtering, and scripting capabilities that make PowerShell truly powerful.
Remember: every manual task you perform repeatedly is a candidate for PowerShell automation. Whether you're checking server connectivity, documenting network configurations, or troubleshooting user issues, PowerShell provides the tools to work smarter, not harder.
For organizations managing complex network infrastructures, combining PowerShell's flexibility with automated network monitoring solutions provides the comprehensive visibility needed to maintain reliable, high-performance networks.
Ready to take your network management to the next level? Start experimenting with these PowerShell networking commands today—your future self will thank you when you're automating tasks instead of manually troubleshooting the same issues over and over.