How to Disable/Enable Protocols of a Specific Adapter via Command Line or Registry Edit

0

View of the properties window.

I need to figure out a way to automate the disabling of certain network protocols of specific network adapters. I know I can open up the window and uncheck the various protocols such as "Internet Protocol Version 6 (TCP/IPv6)" from a specific network adapter's properties window, but I need to find a way to do that via command-line or via the registry so that I can automate the process. Any ideas? -Thanks!

Ken Anderson

Posted 2017-03-20T20:53:35.320

Reputation: 1

Answers

0

I've done this for some of the scripts I use at work.

At any time there are a number of adapters registered, some loopback. The main problem is in detecting the correct ones your targeting, and then filtering out the rest. You should also be aware that changes made by the utility netsh may not propagate to the wmi interface until a reboot is completed.

I would suggest looking into the WMI member functions of Win32_NetworkAdapterConfiguration or using netsh.

You don't reference an OS, I assume your referring to windows. I would suggest Powershell as it comes bundled with Windows 7 and later and is installable on previous systems. It also allows access to the dotnet function api.

Lorek

Posted 2017-03-20T20:53:35.320

Reputation: 1