| |
anurag_cancerian
Posts: 5
Score: 0
Joined: 5/4/2008
Status: offline
|
Hi, I have below script which can change DNS on given server but I want to change DNS on multiple servers NIC cards can someone help me to modify script which can change DNS on multiple servers NIC cards. Script: On Error Resume Next servernames = Array("server1","server2") strComputer = "." NewDNS1 = "1.2.2.1" NewDNS2 = "1.2.2.2" 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 For i = 0 to 1 arrDNS = Array(NewDNS1,NewDNS2) objNetCard.SetDNSServerSearchOrder(arrDNS) Next Thanks and Regards, Anurag
|
|