PowerShell - 3 part with .bat to clean Teredo, Isatap and 6to4 hidden adapters
- Jon Boyette
- Jan 10, 2022
- 1 min read
Starting with the bat, save this simple .bat with name of choice, win it runs, it displays the network ID's for you NIC(s), These are in the event you are not using IPV6.
@Echo Off
netsh int ipv4 show interfaces
timeout /t 30 /nobreak
2nd - Save or copy and paste locally on machine and run, this will disable the hidden IPV6 adapters. If you use IPV6, of course this isnt applicable.
Set-NetTeredoConfiguration -Type Disabled
Set-NetIsatapConfiguration -State Disabled
Set-Net6to4Configuration -State disabled
3rd. This is where the ID becomes important, save as a .ps1, or copy and paste, enter the ID that the bat shown is the card in use that needs the edits.
#Set DNS Suffix - Must know Interface Index
$a = Read-Host "Enter Interface ID Number"
$b = Read-Host "Enter Domain FQDN to set DNS Suffix"
Set-DnsClient -InterfaceIndex $a -ConnectionSpecificSuffix $b
Now the IPconfig will not be riddled with hidden adapter "growing" information and a much cleaner and resource friendly IPV4 network as the result.
Comments