Windows command guide
How to Restart Active Network Adapters with PowerShell
Sometimes Windows networking breaks because the adapter itself is stuck after sleep, docking changes, driver hiccups, or VPN removal. Restarting the active adapter is a focused recovery step that can restore traffic without forcing a full reboot.
This guide is written around the specific symptom-command match for restart active network adapters, not as a generic dump of terminal lines. That makes the page more useful for real troubleshooting and reduces the chance of running the wrong repair step.
PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false"
Best place to run it
PowerShell is the right execution context for this page. Even when elevation is not always required, using the right shell prevents syntax mistakes and makes the output easier to trust.
Fast repair workflow
- Start from the exact symptom on this page: The network icon shows a problem after sleep or undocking
- Run the network repair line exactly as shown: PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false".
- This workflow is tuned for this repair, so avoid mixing it with unrelated repair commands too early.
- Disconnect and reconnect the adapter or reboot the PC if the reset changed saved network state.
- Verify raw connectivity, name resolution, and IP assignment before moving to router or driver troubleshooting.
Copyable wrapper script
Use this wrapper when you want the page command inside a clearer script block with start and finish prompts.
$ErrorActionPreference = "Continue"
Write-Host "Run this PowerShell block in the matching shell and read the output carefully."
Write-Host "Starting targeted Windows repair step..."
PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false"
Write-Host "`nReview the output above before moving to the next fix."
Verification commands after the repair
These follow-up commands help you check whether the repair actually changed the Windows state that matters, instead of assuming success from a single line.
ipconfig /all
ping 1.1.1.1
nslookup example.com
What problem this command is trying to solve
This command targets adapter-level connection problems where Wi-Fi or Ethernet is present but not behaving correctly.
- The network icon shows a problem after sleep or undocking.
- Wi-Fi or Ethernet connected earlier but now will not pass traffic.
- Disabling and enabling the adapter manually usually helps.
How the command works
The PowerShell line finds adapters with the status Up and restarts them without asking for confirmation. That briefly resets the adapter and renegotiates the connection.
When it makes sense to run it
Use it when you want a narrower repair step than a full network reset. It is especially useful on laptops that move between different networks often.
Before you run this command
- Open the shell that matches PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false" before you paste it.
- Confirm that the symptom really matches this guide, especially if you are seeing signs such as: the network icon shows a problem after sleep or undocking.
- Check whether the failure is really system-wide and not just one website, one browser, or one Wi-Fi network.
What result to expect
After running PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false", compare the result against the symptom that brought you here. The most useful checkpoint is whether the network icon shows a problem after sleep or undocking becomes less frequent, changes form, or produces a clearer error message. A command page is stronger when it helps you verify a real change instead of just assuming the line must have worked.
How to verify that it worked
The best verification step after PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false" is to repeat the action that previously triggered the problem. If wi-fi or ethernet connected earlier but now will not pass traffic still appears in exactly the same way, the command probably was not the whole answer and you should move to the next targeted check instead of assuming the page is finished.
Shell and execution context
This command usually does not need a full elevated repair context, but it still works best when you run it in the shell it was written for and read the output carefully.
Before you run it
Your network connection will drop briefly. Do not run it from a remote session unless you are ready for a short disconnect.
When this is probably the wrong fix
This is not the right first fix when one website is down, the ISP has an outage, or only one app is blocked by a firewall rule. Use it when the Windows networking stack or saved network state looks damaged.
What to do if it does not help
If PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false" does not improve the network icon shows a problem after sleep or undocking, move to the next repair step that matches the same symptom family instead of piling on random commands. The best follow-up depends on whether the failure is mainly about connectivity, DNS, IP, proxy, or adapter state.
Frequently asked questions
Should I use PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false" for this exact Windows symptom?
Use it when the behavior on your PC lines up with the repair target on this page: This command targets adapter-level connection problems where Wi-Fi or Ethernet is present but not behaving correctly.
What should I check right after PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false"?
Check whether the original trigger still reproduces the same failure. For this page, a useful checkpoint is whether the network icon shows a problem after sleep or undocking becomes less frequent, changes form, or points you toward a more specific next step.
When should I not rely on PowerShell -Command "Get-NetAdapter | Where-Object Status -eq 'Up' | Restart-NetAdapter -Confirm:$false" alone?
This is not the right first fix when one website is down, the ISP has an outage, or only one app is blocked by a firewall rule. Use it when the Windows networking stack or saved network state looks damaged.