Here is a script that will do it for you:
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()
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next
"/\\/\\o\\/\\/" wrote:
> Paul wrote:
> > I have a bunch of machines that are currently getting IP address information
> > from DHCP, however have static DNS servers.
> >
> > I can not find anything in WMI to change this.
> >
> > I can shell out and use NETSH, however, I would prefer WMI. Does anybody
> > know anything that I am missing?
> just clear the DNSServerSearchOrder
>
> SetDNSServerSearchOrder(null)
>
> gr /\/\o\/\/
> >> Stay informed about: Forcing machine to use DHCP instead of static for DNS sett..