$computer = get-content C:\test\DNS_Server_Name.csv
$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration -computername $computer |where{$_.IPEnabled -eq “TRUE”}
Foreach($NIC in $NICs) {
$DNSServers = “198.102.234.125",”198.102.234.126"
$NIC.SetDNSServerSearchOrder($DNSServers)
$NIC.SetDynamicDNSRegistration(“TRUE”)
}
Getting error "RPC Server is unavailable". However, the script still inputs the DNS server as needed. I ran this with only one server name in the csv file. Any idea why I'm getting this error even though it still seems to work?