WMI的替代方法(获取域名和DNS域后缀) [英] Alternative to WMI (Get Domain Name and DNS domain suffixes)

查看:151
本文介绍了WMI的替代方法(获取域名和DNS域后缀)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我开发了一个库,该库利用WMI查询两个特定的属性,即:

WMI查询

Hi all,

I have developed a library that makes use of WMI to query two specific properties namely:

WMI Query

SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = ''TRUE''



Win32_NetworkAdapterConfiguration属性

DNSDomainSuffixSearchOrder
DNSServerSearchOrder


问题是我可以在某些计算机客户端上获得该值,而在其他计算机客户端上却无法获得该值,原因是MangementObjectCollection中的值为null.是否有其他方法来获取要查询DNS服务器并获取DNS域后缀的服务器IP地址,而无需使用WMI?

或者,如果要使用WMI,我如何获取值?

提前非常感谢.
亲切的问候,



Win32_NetworkAdapterConfiguration properties

DNSDomainSuffixSearchOrder
DNSServerSearchOrder


The problem is that I can get the values on some computer client and on others I can''t, reason being that the value within the MangementObjectCollection is null. Is there any other way of getting hold of the server IP addresses to be used in querying for DNS servers and getting the DNS domain suffixes without making use of WMI?

Alternatively, if WMI is the way to go, how can I get the values?

Many thanks in advance.
Kind regards,

推荐答案

您看到的问题可能意味着它们尚未配置.
如果执行ipconfig/all,而您看不到数据,则表明该数据不存在.
域名和dns域名后缀必须明确配置(在网卡的IPV4属性中,或者如果希望它们显示在任何地方,则随DHCP一起提供.)
The problem you are seeing means probably that they are not configured.
if you do an ipconfig /all, and you don''t see the data, it''s just not present.
Domain name and dns domain suffixes must be configured explictly (in the IPV4 properties of the network card, or be supplied with DHCP, if you want them to show up anywhere.


这篇关于WMI的替代方法(获取域名和DNS域后缀)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆