06-20-2011, 05:18 PM
This is vbscript below works
But if I was to convert it to QM, any ideas how its done.
Currently I do this below but didnt work. :?:
But this simple msgbox below works. :?:
On Error Resume Next
strComputer = "."
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("156.154.70.22", "156.154.71.22")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
NextBut if I was to convert it to QM, any ideas how its done.
Currently I do this below but didnt work. :?:
lpstr code=
On Error Resume Next
strComputer = "."
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("156.154.70.22", "156.154.71.22")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next
VbsExec codeBut this simple msgbox below works. :?:
