PowerTip: Use PowerShell to Disable All Network Adapters

Summary: Use Windows PowerShell to disable all network adapters on your system.

Hey, Scripting Guy! Question I often work in offline situations, and I would like to disable all network adapters on my laptop for security reasons
           and to help to extend battery life. How can I use Windows PowerShell to do this easily?

Hey, Scripting Guy! Answer Use the Get-NetAdapter cmdlet to retrieve all network adapters and pipe the results to the 
           Disable-NetAdapter cmdlet. To suppress confirmation messages use the –Confirm parameter
           and set it to $false:

Get-NetAdapter | Disable-NetAdapter -Confirm:$false

Note  This command requires admin rights.

Comments (1)

  1. Note that this only works on Win8/Server2012
    For previous versions you can still use the cmd way:

    netsh interface set interface name="Local Area Connection" admin=disabled

Skip to main content