_N_了吧唧的_ 发表于 2018-9-1 13:00:41

powershell 脚本设置DNS-zenge

#!powershell  
$adapter = Get-NetAdapter |?{$_.InterfaceDescription -ne "Microsoft KM-TEST Loopback Adapter"}
  
if ($adapter -ne $null)
  
{
  
    $adapter | Rename-NetAdapter -NewName "Eth"
  
   disable-NetAdapterBinding -Name "Eth" -ComponentID ms_tcpip6
  
   netsh interface ipv4 set dns name="Eth" source=static address=114.114.114.114 primary
  
   netsh interface ipv4 add dnsserver name="Eth" address=8.8.8.8 index=2
  
   netsh interface ipv4 add dnsserver name="Eth" address=202.96.209.133 index=3
  
}


页: [1]
查看完整版本: powershell 脚本设置DNS-zenge