Avilith – Scripts

Reset Network Adapter

Category: Network Troubleshooting

Back to Scripts

Disables and re-enables all physical network adapters to resolve connectivity issues.


$adapters = Get-NetAdapter -Physical | Where-Object { $_.Status -eq "Up" }
foreach ($adapter in $adapters) {
    Write-Host "Disabling adapter: $($adapter.Name)" -ForegroundColor Yellow
    Disable-NetAdapter -Name $adapter.Name -Confirm:$false
    Start-Sleep -Seconds 2
    Write-Host "Re-enabling adapter: $($adapter.Name)" -ForegroundColor Yellow
    Enable-NetAdapter -Name $adapter.Name -Confirm:$false
}
Write-Host "Network adapters reset completed." -ForegroundColor Green

        

Comments

Log in to leave a comment.