Disable IPV6 on specific NIC via PowerShell using Com object in Windows Server 2008 R2?
I need a script build of Windows Server 2008 R2, preferably in PowerShell. I need to disable or disable IPV6 on a specific network adapter (same network adapter every time). Currently I have to install it manually. I don't want to completely disable IPV6 for the whole server and other things might use this in the future. Is there an object I can reference in a PowerShell command that detects my "Intel (R) PRO / 1000 MT" NIC network connection and disable IPV6? Unfortunately, Group Policy is not an option, the boss says. I tried to find a suitable WMI object through "PowerShell Scriptomatic" but could not find the difference between the option enabled and disabled in the Intel NIC. Thanks in advance.
source to share
Before uninstalling IPV6, you can read these Microsoft articles:
How to disable IP version 6 (IPv6)
What's Microsoft's recommendation to disable IPv6?
In conclusion, you can disable IPV6 on all interfaces using (detailed explanation here ):
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters]
"DisabledComponents"=dword:ffffffff
Edited
As per @David Brabant's comment about allowing IPV6 on only one adapter, you can bind or unbind it using a registry key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip6\Linkage]
"Bind"=RegmultiSZ
kind:
\Device\{DBB82A20-A485-4CB6-AD31-EF14B91F5EFB}
You can build this line with:
# Public Name NetworkCard Name
$networkCardName = "Connexion au réseau local 1"
# Get Device GUID
$guid=(gwmi -query "select * from win32_networkadapter where netconnectionid= '$networkCardName'").guid
source to share
Microsoft has a command line utility called nvspbind ( https://gallery.technet.microsoft.com/Hyper-V-Network-VSP-Bind-cf937850 ) that can disable ipv6 on a specific interface. It seems to be identical to unchecking the IPv6 checkbox in the adapter settings dialog. You can run this program from a script or your program.
Command line arguments to disable IPv6 on a specific interface:
nvspbind -d {GUID} ms_tcpip6
source to share