Asagidaki scriptten yararlanarak network kartinizin TCP/IP ayarlarinda bulunan DNS sunuculari bolumunu konfigure edebilirsiniz, asagidaki ornegin birincil icin 192.168.1.1 , ikincil icin ise 192.168.1.2 IP adresli DNS sunuculari icin oldugunu goreceksiniz, scriptin bu kisimlari kendi ihtiyacaniz dogrultusunda degistirip kullanabilirsiniz.
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("192.168.1.1", "192.168.1.2")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next
No comments:
Post a Comment