Often when running a IPv4 only network it can be nice to not get rid of a lot of unneeded info in the logs when it’s not in use.
If you are like me and like to have some control over what goes around your network, it is good to remove some of that noise that really doesn’t need to be there when checking logs and stuff.
I wrote a simple script that can enable/disable IPv6 on a specific network card or all network cards from Powershell, it uses standard commands, but wrapped up in a script.
On it’s own it can be quicker just to type the command by itself for a single network card but if you use it with other script or commands when you prep or config a new machine or reinstalling, it comes quite handy.
To find out specific network card names run the following command.
# Getting input parameters for script execution.param([Parameter(Mandatory=$true)][string]$AdapterName,[Parameter(Mandatory=$true)][string]$ipv6)# Enable IPv6.if($ipv6-ieq"enable"){if($AdapterName-ieq"All"){# Get all adapter names$AdapterList=Get-NetAdapter|SELECT Name-ExpandPropertyName# Do the changes.foreach($ain$AdapterList){Enable-NetAdapterBinding-Name"$a"-ComponentIDms_tcpip6}}else{# Just change the one specified.Enable-NetAdapterBinding-Name"$AdapterName"-ComponentIDms_tcpip6}}# Disable IPv6.if($ipv6-ieq"disable"){if($AdapterName-ieq"All"){# Get all adapter names$AdapterList=Get-NetAdapter|SELECT Name-ExpandPropertyName# Do the changes.foreach($ain$AdapterList){Disable-NetAdapterBinding-Name"$a"-ComponentIDms_tcpip6}}else{# Just change the one specified.Disable-NetAdapterBinding-Name"$AdapterName"-ComponentIDms_tcpip6}}