When your internet starts acting up, the usual reflex is to unplug your router, reconnect Wi-Fi, or restart your computer. That works—but if you’re managing systems, troubleshooting remotely, or just want more control, PowerShell gives you a much cleaner way to reset your network connection at the adapter level.
This script temporarily disables your network adapter, re-enables it, and then releases and renews your IP address—essentially forcing a full network refresh without rebooting your machine.
Important: Run as Administrator
Because this script interacts directly with system-level network settings, it must be run in an elevated PowerShell session.
If you don’t, nothing will work—and PowerShell will politely tell you to go back and try again properly.
Network Reset Script
Here’s the full script:
# Check for Administrator privileges
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Warning "This script requires elevated privileges. Please restart PowerShell as an Administrator and try again."
Break
}
# Prompt for the network adapter name (common defaults: "Ethernet" or "Wi-Fi")
$adapterName = Read-Host "Enter the name of the Network Adapter to reset (e.g., Ethernet, Wi-Fi)"
try {
# 1. Disable the Adapter
Write-Host "Disabling '$adapterName'..." -ForegroundColor Cyan
Disable-NetAdapter -Name $adapterName -Confirm:$false -ErrorAction Stop
# Pause to allow the system to register the hardware state change
Write-Host "Waiting 3 seconds..."
Start-Sleep -Seconds 3
# 2. Enable the Adapter
Write-Host "Enabling '$adapterName'..." -ForegroundColor Cyan
Enable-NetAdapter -Name $adapterName -Confirm:$false -ErrorAction Stop
# Pause to allow the network link to establish before requesting a new IP
Write-Host "Waiting 5 seconds for the link to establish..."
Start-Sleep -Seconds 5
# 3. Renew the IP Address
Write-Host "Releasing current IP Address..." -ForegroundColor Cyan
ipconfig /release * | Out-Null
Write-Host "Renewing IP Address..." -ForegroundColor Cyan
ipconfig /renew * | Out-Null
Write-Host "Network adapter '$adapterName' has been reset and the IP renewed successfully!" -ForegroundColor Green
} catch {
# Error handling if the adapter name is typed incorrectly or doesn't exist
Write-Host "An error occurred: $_" -ForegroundColor Red
}
What This Script Actually Does
Think of this as a “hard reset” for your network interface:
- Disables the network adapter
- Cuts the connection completely (Wi-Fi or Ethernet)
- Re-enables it
- Forces Windows to renegotiate the connection
- Releases the current IP
- Drops your existing DHCP lease
- Renews the IP address
- Requests a fresh IP from your router or network
The result is a clean network restart without rebooting your machine.
How to Use It
- Open the Start menu
- Search for PowerShell
- Right-click ? Run as Administrator
- Paste the script directly, or save it as:
Reset-Network.ps1
Then run it with:
.\Reset-Network.ps1
- When prompted, enter your adapter name:
EthernetWi-Fi- or whatever it appears as in your system
Why This Is Useful
This script is especially helpful when:
- Your internet is connected but not loading anything
- DNS or DHCP issues are suspected
- You’re troubleshooting remote machines
- You want a faster alternative to rebooting
- You manage multiple systems and need repeatable fixes
Optional Improvements (If You Want to Go Further)
This script can easily be extended. A few useful upgrades:
- Automatically detect the active adapter (no prompt needed)
- Log results to a file for system administration records
- Run silently for remote troubleshooting tools
- Add DNS flush (
Clear-DnsClientCache) - Build it into a larger network diagnostics toolkit



