Disable IPV6
Sometimes you would like to disable IPV6 on the servers even Microsoft not recommends it.
Get the binding information for a network adapter first.
Use the
cmdlet Get-NetAdapterBinding
As you can see the component ID of IPv6 is ms_tcpip6. So use the Disable-NetAdapterBinding cmdlet as follow.
Disable-NetAdapterBinding –InterfaceAlias “Ethernet0” –ComponentID ms_tcpip6
The result will be
Summary:
Gets the network adapter binding information first
Get-NetAdapterBinding –InterfaceAlias “Ethernet0”
Then disable the IPv6
Disable-NetAdapterBinding –InterfaceAlias “Ethernet0” –ComponentID ms_tcpip6
Take it easy 😉
You could also do
$nic = get-netadapter
Disable-NetAdapterBinding –InterfaceAlias $nic.name –ComponentID ms_tcpip6
Olivier,
Your 2nd line should be
Disable-NetAdapterBinding –Name $nic.name –ComponentID ms_tcpip6
Please refer to this Microsoft support article on how to disable IPv6 the right way.
https://support.microsoft.com/en-us/help/929852/how-to-disable-ipv6-or-its-components-in-windows