I need to switch Internet Protocol Version 4 (TCP/IPv4) and Internet Protocol Version 6 (TCP/IPv6) settings for DNS server configuration from “Obtain DNS server address automatically” to hard coded values (for Google’s DNS servers) and back. It’s kind of a hassle to do manually (I need to go to Control Panel-Network and Internet-Network Connections, open Wireless Network Connection 2, then open Properties for the corresponding version, enter the DNS server values, and repeat for the other one). Is there a utility or script that would automate the process? Thanks.
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" $wmi.SetDNSServerSearchOrder("220.127.116.11"."18.104.22.168")
(no parameters=null, this will put it back in automatic mode)