Hi,
I am trying to get a script together that will configure a static IP address, DNS, and WINS server settings. The instructions here are great, except the DNS part doesn't work.
http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx
Here are the commands in the script:
$wmi = Get-WmiObject win32_networkadapterconfig
uration -filter "ipenabled = 'true'"
$wmi.EnableStatic("192.168
.1.2", "255.255.255.0")
$wmi.SetGateways("192.168.
1.1", 1)
$wmi.SetDNSServerSearchOrd
er("208.67
.220.220",
"208.67.222.222", "8.8.8.8")
$wmi.SetWINSServer("192,16
8,1,1")
Each time I run the script it fails on the DNS portion. I am doing this on Windows Server 2012. The specific error message is: Cannot find an overload for "SetDNSServerSearchOrder" and the argument count: "3".
Any ideas? Thanks