So the other day a few friends and I were discussing some odd behavior that IPV6 has. I noticed early on that it plays havoc with my DNS between IPv4 and IPv6 workstations and their respective connections to servers. Steve Murawski mentioned that he had problems with bandwidth regarding IPv6 and its desire to tunnel over IPv4. Now I don’t have all the details but disabling IPv6 and its attendant interface objects seems to solve both the DNS and network slowdown issue. I slapped a quick and dirty powershell script together that allowed me to quickly update my servers to remove the IPv6 suite. I should note that the commands are also courtesy of Steve. Thanks Steve!

Some of you may have seen where I made a mistake with my script. this has been updated on 12-23. You can still use my original commands so long as you do them live at the command window. As a script, it fails. So enter the commands one at a time and all is well. This doesn’t help much unless its a script though. So the second block of code is updated to work as a script.

Enter-PSSession PUT COMPUTER NAME HERE
Write-Host "Disabling isatap"
netsh interface isatap set state disabled
Write-Host "Disabling teredo"
netsh interface teredo set state disabled
write-host "Disabling 6TO4"
netsh interface 6TO4 set state disabled

Write-Host "Showing interfaces"

netsh.exe interface ipv6 show interfaces
ipconfig
ipconfig /registerdns
Exit-PSSession

Just a note for me, if you see the system.dns exception, remember to show hidden devices and remove the extra 6t04 and teredo adapters.
Use this section if you want to execute this as a script.

#* Filename: KillStupidIPV6.ps1
#*=====================================================================
#* Created: [12-21-10]
#* Author: Tim Lemmers
#* email: tim@liquidclever.com
#
#*=====================================================================
#get the remote computer name from User input

$Srv = Read-Host "Type Machine name"




$session = new-pssession -ComputerName $Srv 
Invoke-command -session $session -scriptblock { netsh interface isatap set state disabled }  
Invoke-command -session $session -scriptblock { netsh interface teredo set state disabled } 
Invoke-command -session $session -scriptblock { netsh interface 6TO4 set state disabled } 
Invoke-command -session $session -scriptblock { netsh.exe interface ipv6 show interfaces } 
Invoke-command -session $session -scriptblock {  ipconfig } 
Invoke-command -session $session -scriptblock { ipconfig /registerdns }

I nearly forgot! you may need to enable remote access to your servers. the best way I’ve found to do so is this:

Enable-PSRemoting