使用wmi通过局域网连接到远程PC并获取BIOS信息 [英] Use wmi to connect through lan to remote pc and get bios info

查看:165
本文介绍了使用wmi通过局域网连接到远程PC并获取BIOS信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问Iir是我老板的要求吗?我可以通过Lan连接到远程计算机并获得带有Windows WMI服务的BIOS信息吗?计算机可能没有操作系统,但它将打开电源。可以连接管理范围吗?任何一行代码?



我尝试了什么:



tutorial来自互联网的代码这对于我在c中的问题代码很有意思。



字符串路径= @\\ {0} \ROOT \CIMV2;

String BiosVersion = String.Empty;



ConnectionOptions co = new ConnectionOptions();

ManagementScope scope =

新的ManagementScope(String.Format(路径,。),co);



scope.Connect();



ObjectQuery query = new ObjectQuery(SELECT * FROM Win32_BIOS);

ManagementObjectSearcher search = new ManagementObjectSearcher(范围,查询);



ManagementObjectCollection moc = search.Get();



foreach(管理对象mo in moc)

{

BiosVersion =(String)mo [SMBIOSBIOSVersion];



}

解决方案

计算机没有操作系统,你想要c使用 WINDOWS 进行管理管理工具?

如果您/您的Boss可以更改要求,将有机会通过WMI读取一些(!)bios信息以启动Windows网络中的计算机(我希望它是一个域,你的示例代码没有显示的是authtentication ...)但是不要认为因为有一个ManagementObject定义它将为每个pc实现... WMI哦我的....

I want to ask Iir is a request of my boss to do it) can I connect through Lan to remote computer and get bios Info with the Windows WMI service? the computer might not have OS but it will be powered on. Can connect with managment scope? any Line of code?

What I have tried:

tutorial code from Internet this is interesting for my question code in c#

String path = @"\\{0}\ROOT\CIMV2";
String BiosVersion = String.Empty;

ConnectionOptions co = new ConnectionOptions();
ManagementScope scope =
new ManagementScope(String.Format(path, "."), co);

scope.Connect();

ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_BIOS");
ManagementObjectSearcher search = new ManagementObjectSearcher(scope, query);

ManagementObjectCollection moc = search.Get();

foreach (ManagementObject mo in moc)
{
BiosVersion = (String)mo["SMBIOSBIOSVersion"];

}

解决方案

the computer has no OS and you want to connect with WINDOWS Management instrumentation?
If you/your Boss can change the requirement there will be a chance to read some(!) bios Information through WMI for powered-on Windows computers in the network (I hope it's a domain, what your example codes doesn't show is authtentication...) But don't think that because there is a ManagementObject definied it will be implemented for each pc... WMI oh my....


这篇关于使用wmi通过局域网连接到远程PC并获取BIOS信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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