Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Altering DNS values

Status
Not open for further replies.

Amir111

Technical User
Nov 28, 2007
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top