≡ Menu

PowerShell: Disable IPv6 on network adapter in Windows

Today’s post is about disabling IPv6 protocol from given network adapter in Windows operating system using PowerShell. Reasons for disabling it will vary and we are not going to discuss about that topic now. We will purely focus on disabling it using PowerShell.

First task is to get list of network adapters in the computer. If you already know the name of the network adapter for which you want to disable IPv6, then you can proceed to next step directly.

Get-NetAdapter

This will show list of network adapters in the local computer. Let us say I want to check if IPv6 is enabled on network named LocalNetwork and then disable it.

We can first check if it is enabled on LocalNetwork by running below command.

Get-NetAdapterBinding -Name LocalNetwork

You can see in the output that Internet Protocol Version 6 (TCP/IPv6)(ms_tcpip6) is in enabled state. We can now disable it by running below command.

Disable-NetAdapterBinding -Name LocalNetwork -ComponentID ms_tcpip6 -PassThru

You can see the output that this component is disabled now. You can double check by below command again.

Get-NetAdapterBinding -Name LocalNetwork

Please note that above procedure will disable IPv6 on selected network adapter only. If you want to disable on total host, you need to follow separate steps.

 

Hope this helps.

Comments on this entry are closed.

  • sadegh March 11, 2019, 11:53 am

    very good!!

  • Raffael July 3, 2019, 5:14 pm

    Good Stuff! Btw. You can disable ipv6 on all adapters by adding * after the -Name

    Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6 -PassThru

  • emnavarro02 May 24, 2020, 2:08 am

    Do you know what is the difference between running `Disable-NetAdapterBinding -Name LocalNetwork -ComponentID ms_tcpip6 -PassThru` and `Set-NetAdapterBinding -Name $nic.Name -ComponentID “ms_tcpip6” -Enabled $false` ?

    • Wintel Rocks June 28, 2020, 6:18 pm

      The answer is at https://docs.microsoft.com/en-us/powershell/module/netadapter/set-netadapterbinding?view=win10-ps

      Description
      The Set-NetAdapterBinding cmdlet sets the binding state of a transport or filter on a network adapter. By default only visible bindings are set unless the AllBindings parameter is specified. If only enabling or disabling bindings, then the Enable-NetAdapterBinding or Disable-NetAdapterBinding cmdlets can be used. If you disable or enable a network adapter binding, the cmdlet can automatically enable or disable other network adapter bindings.

  • AVT June 13, 2020, 12:37 am

    Why do need “-PassThru” in the example? It should be working normally without it.

    • Wintel Rocks June 28, 2020, 6:15 pm

      -PassThru shows the object once disabled. Otherwise you will see nothing even if the command is succssful.

  • Erik August 13, 2020, 10:29 am

    Any idea how to do this for a vpn = WAN Miniport (L2TP)? It doesn’t get the treatment as other network adapter types.
    It would be nice if I could use:
    Set-NetAdapterBinding -Name “Local Area Connection* 3” -ComponentID ms_tcpip6 -Enabled $false
    OR
    Set-NetAdapterBinding -Name “MyCompany-VPN” -ComponentID ms_tcpip6 -Enabled $false

    …… but, that’s not an option. It’s not available by what name you gave it or by the system name.