Disable/Enable all Network Adapters

Disable/Enable all Network Adapters

PowerShell script that can disable and then enable all network adapters on a computer. Please note that running this script will interrupt all network

Managing VMware Snapshots with Powershell
Testing SSL and TLS with PowerShell
Remove Windows Bloatware

PowerShell script that can disable and then enable all network adapters on a computer. Please note that running this script will interrupt all network connectivity on the computer while the network adapters are disabled.

This script works by first retrieving all network adapters on the computer using the Get-NetAdapter cmdlet. It then disables all of these adapters using the Disable-NetAdapter cmdlet. After waiting for a few seconds to ensure that all adapters are disabled, it enables all of the adapters using the Enable-NetAdapter cmdlet.

Please note that you need to have the necessary permissions to disable and enable network adapters on the computer. Always test scripts in a controlled environment before using them in production.

# Get all network adapters
$adapters = Get-NetAdapter

# Disable all network adapters
$adapters | Disable-NetAdapter -Confirm:$false

# Wait for a few seconds
Start-Sleep -Seconds 5

# Enable all network adapters
$adapters | Enable-NetAdapter

 

COMMENTS

WORDPRESS: 0