Advertisement
ancavazz

dnsADGuard.vbs

Sep 14th, 2021
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. strComputer = "."
  2. Set objWMIService = GetObject("winmgmts:" _
  3. & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  4.  
  5. Set colNetCards = objWMIService.ExecQuery _
  6. ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
  7.  
  8. For Each objNetCard in colNetCards
  9. arrDNSServers = Array("94.140.14.14", "94.140.15.15")
  10.     objNetCard.SetDNSServerSearchOrder(arrDNSServers)
  11. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement