PowerShell version 3 makes it easier than ever to control your NIC (Network Interface Card) with Enable and Disable-NetAdapter cmdlets.
Tutorial for Disable-NetAdapter
There are scenarios where you would need to disable a network adapter, for example controlling Wi-Fi usage. On the other hand, there are situations where your computer has multiple NICs and you want to choose which one is active.
Windows PowerShell v 3.0 offers an easier, more versatile alternative to grappling with 'Netsh' at the command line: Netsh interface set interface <NIC Name> Disabled
The only problem with PowerShell's Disable-NetAdapter is that you need to know the Name of your NIC. This is where the sister cmdlet Get-NetAdapter is handy.
Discover the Names of Your NICs
# PowerShell script to enumerate your network cards.
Note 1: You can research more properties by appending | Get-Member.
Preliminary step: before you launch PowerShell, right-click and 'Run as Administrator'.
# PowerShell script to disable your network cards.
Note 2: Most likely you need to change the name 'Wi-Fi' for the name of your network card revealed by the Discover script above.
Note 3: You can omit the -Name parameter as PowerShell v 3.0 assumes that the word after NetAdapter is indeed the name of the NIC.
SolarWinds' Network Performance Monitor will help you discover what's happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
For testing purposes you may wish to 'Enable' the network card, and thus reverse the effect of Disable-NetAdapter.
# PowerShell script to enable your network card.
Note 4: Remember this: before you launch PowerShell 3.0 ISE, right-click and Run as Administrator.
Get-Command -Noun netadapter
If you don't have the cmdlet / function called Disable-NetAdapter, then firstly, check that your version of PowerShell is v 3.0. It also seems that this cmdlet is only available in Windows 8 and Server 2012.
This freeware monitor is great for checking whether your network's load-balancing is performing as expected, for example, are two interfaces are getting about equal traffic?
It's easy to install and straightforward to configure. You will soon be running tests to see how much network bandwidth your applications consume.
The GUI has a lovely balance between immediate network traffic data in the middle, combined with buttons to seek related data and configuration settings. Give this monitor a try, it's free!
If you need more comprehensive
network analysis software:
More PowerShell v 3.0 Networking Cmdlets
One way to discover more about the new version 3 cmdlets is look at the 'Modules' in the Commands pane, once the ISE has launched.
Summary of PowerShell Disable-NetAdapter Cmdlet
PowerShell version 3 brings hundreds of new cmdlets. If you research the NetAdapter noun then you will see a family of Get, Enable and Disable-NetAdapter cmdlets.
If you like this page then please share it with your friends
See more Microsoft PowerShell v 3.0 examples