Script to Reset Windows Network Adapters

Last Updated on April 18, 2021 by admin

If you want to reset network adapters on Windows Server, execute the following script on PowerShell (run PowerShell with admin privileges)

You have to run the script locally on a server machine.

while($(ping 8.8.8.8) -like "*Reply*"){
"Server replied"
}
"Server unreachable"
Restart-NetAdapter Ethernet0
Send-MailMessage -From "me@yourdomain.com" -To "admin@yourdomain.com" -Subject "server down" -SmtpServer "smtp.yourdomain.com"

Reference

Leave a Comment