I know that you can set the value in WMI by calling SetDNSServerSearchOrder
with no parameters. So you might think that you could just query
DNSServerSearchOrder and get back something empty or null if "Obtain DNS
Server Address Automatically" is set. But actually, DNSServerSearchOrder
returns the DNS addresses that are currently assigned, so you can't tell if
they were automatically assigned or manually assigned.
Thanks for any help.
--
Joseph Morales
The only workaround I can find is a registry hack. First, you need to query
the GUID assigned to a particular NIC. To do this, read the SettingID
property of Win32_NetworkAdapterConfiguration. Then, read the following
registry value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{GUID
value}\NameServer
This registry value is an empty string if "Obtain DNS Server Address
Automatically" is set for a NIC; otherwise it returns a DNS address.
--
Joseph Morales