-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFix-Network-Admin.ps1
More file actions
28 lines (20 loc) · 948 Bytes
/
Fix-Network-Admin.ps1
File metadata and controls
28 lines (20 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Fix-Network.ps1
# Script to reset network IP and flush DNS for troubleshooting connectivity issues.
Write-Host "🚧 Starting network repair process..." -ForegroundColor Cyan
# Releasing current IP address
Write-Host "`nReleasing current IP address..."
ipconfig /release
# Renewing IP address
Write-Host "`nRequesting new IP address..."
ipconfig /renew
# Flushing DNS using ipconfig
Write-Host "`nFlushing DNS cache (via ipconfig)..."
ipconfig /flushdns
# Flushing DNS using PowerShell cmdlet
Write-Host "`nFlushing DNS cache (via Clear-DnsClientCache)..."
Clear-DnsClientCache
# Optional: Restart network adapter (commented out for safety)
# Write-Host "`nRestarting network adapter..."
# Get-NetAdapter | Where-Object { $_.Status -eq "Up" } | Restart-NetAdapter -Confirm:$false
Write-Host "`n✅ Network reset complete! Please try reconnecting or reloading your services." -ForegroundColor Green
Read-Host -Prompt "Press Enter to exit"