Hello, as you may guess, new to VB. I got this script from MS to alter DNS values of an remote server. It works on some, but not all servers. We have all 2000/2003 servers with very similar OS and hardware confis. Any ideas?
Here is the script from MS site:
On Error Resume Next
strComputer = "SomeServer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
arrDNSServers = Array("10.30.10.10")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next
Here is the script from MS site:
On Error Resume Next
strComputer = "SomeServer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
arrDNSServers = Array("10.30.10.10")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next