i can set TCP/IP Preferred DNS and Alternate DNS with that code below;
i need help to restore the default (" . . . "," . . . ")Code:Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration") For Each objNIC In objNICs If objNIC.IPEnabled Then objNIC.SetDNSServerSearchOrder Array("4.2.2.1","4.2.2.2") End If Next
i used this 3 code below but i couldnt manage it;
Code:Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration") For Each objNIC In objNICs If objNIC.IPEnabled Then objNIC.IPDisable End If NextCode:Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration") For Each objNIC In objNICs If objNIC.IPEnabled Then objNIC.SetDNSServerSearchOrder Array(" . . . "," . . . ") End If NextCode:Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration") For Each objNIC In objNICs If objNIC.IPEnabled Then objNIC.SetDNSServerSearchOrder Array("0.0.0.0","0.0.0.0") End If Next



