主板ID - WMI C ++ - 可靠? [英] Motherboard ID - WMI C++ - Reliable?

查看:1259
本文介绍了主板ID - WMI C ++ - 可靠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C ++类中使用WMI来检索我的主板的序列号。
查询如下:

 SELECT SerialNumber FROM Win32_BaseBoard

我自己写了查询,所以我不确定是否正确,但它确实返回的东西:
/ 9637CW1 / CN1296131Q0BA8 / 。返回的字符串在多台计算机上是相同的格式,所以我假设查询是正确的。



我的问题是:我真的查询主板序列号这里?因为我看到另一个类Win32_MotherboardDevice(没有序列号属性)。将此作为计算机标识符是个好主意吗?我目前使用的硬盘序列号,但我认为使用一个更可靠的组件,如主板的序列号会更好,因为一个磁盘更可能更改比主板。



谢谢:)

解决方案

我发现的是检索主板的序列号根据制造商和分销渠道,产生非常不同的结果。一些制造商向最终客户销售并具有良好的支持流程和设备修复将一致地设置WMI的序列号信息。



由于序列号位于基于制造商的特定域或名称空间内,因此它是虽然不太可能,不同的制造商可能使用相同的序列号,所以你真的需要知道制造商和序列号。



某些销售点终端是一致的关于在发生故障的母板的情况下用于母板更换的序列号和部分过程,是将替换板的序列号设置为被替换的板的序列号。这意味着有人可能有几个设备相同的序列号类似于做LAN网卡MAC欺骗。



WMI查询将有所不同的序列号提供。



查看 Win32_MotherboardDevice 的文档,并尝试几个属性,似乎没有很多有用的数据,当然不是类似于唯一的序列号。



在戴尔笔记本电脑上使用Windows XP时我运行一个C ++应用程序,使用WMI查看几个不同的 Select WMI查询的结果几个不同的属性,我得到以下结果:



连接到ROOT \CIMV2 WMI命名空间

查询SELECT * FROM Win32_SystemEnclosure
SMBIOS SerialNumber:49495G1
SMBIOS名称:系统机箱
SMBIOS SMBIOSAssetTag:
SMBIOS制造商:Dell Inc.

查询SELECT * FROM Win32_BaseBoard
SMBIOS SerialNumber:.49495G1.CN486438441035。
SMBIOS产品:0UY141
SMBIOS名称:基板
SMBIOS制造商:Dell Inc.

查询SELECT * FROM Win32_BIOS
SMBIOS序列号:49495G1
SMBIOS名称:Phoenix ROM BIOS PLUS版本1.10 A10
SMBIOS制造商:Dell Inc.

查询SELECT * FROM Win32_ComputerSystem
SMBIOS名称:CIT-31204E1FF03
SMBIOS制造商:Dell Inc.

查询SELECT * FROM Win32_ComputerSystemProduct
SMBIOS名称:Latitude D830
SMBIOS识别号码:49495G1
SMBIOS UUID:4C4C4544-0039-3410 -8039-B4C04F354731

在这台笔记本电脑底部看到一个贴有条形码的贴纸与打印服务标签49495G1,因此对于这台笔记本电脑,检索的序列号是服务标签标识符。我可以访问戴尔网站,在支持区域中查找此服务标签。



一个新的销售点终端用于转售POS Ready 7版本的Windows以下输出使用相同的C ++ WMI应用程序。这类似于我从自己购买的零件,也没有序列号的PC构建的输出PC运行Windows 8.1。

 连接到ROOT \CIMV2 WMI命名空间

查询SELECT * FROM Win32_SystemEnclosure
SMBIOS序列号:无
SMBIOS名称:系统机箱
SMBIOS SMBIOSAssetTag:无
SMBIOS制造商:由OEM填写

查询SELECT * FROM Win32_BaseBoard
SMBIOS序列号:无
SMBIOS产品:EIN70-SAM
SMBIOS名称:基板
SMBIOS制造商:INTEL Corporation

查询SELECT * FROM Win32_BIOS
SMBIOS SerialNumber:无
SMBIOS名称:BIOS日期:10/15/13 20:06:15 Ver:04.06.05
SMBIOS制造商:American Megatrends Inc.

查询SELECT * FROM Win32_ComputerSystem
SMBIOS名称:GENPOSA-1
SMBIOS制造商:由OEM

查询SELECT * FROM Win32_ComputerSystemProduct
SMBIOS名称:EIN70-SAM
SMBIOS标识号:无
SMBIOS UUID:03000200-0400-0500-0006-000700080009


I'm using WMI in C++ classes to retrieve the serial number of my motherboard. The query is the following :

"SELECT SerialNumber FROM Win32_BaseBoard"

I wrote the query myself so i'm not certain it is correct, but it does return something : /9637CW1/CN1296131Q0BA8/. The returned string is in the same format on multiple computers so i assume the query is correct.

My question is : am i really querying the motherboard serial number here ? Because i saw another class called "Win32_MotherboardDevice" (which has no "serial number" property). Would it be a good idea to use this as a computer identifier ? I am currently using the HDD serial number, but i thought using the serial number of a more reliable component such as the motherboard would be better since a disk is more likely to be changed than a motherboard.

Thank you :)

解决方案

What I have found is that retrieving the serial number of the mother board can result in very different results depending on the manufacturer and the distribution channel. Some manufacturers who sell to the end customer and have good support processes with equipment repair will be consistent about setting the serial number information for WMI. Other manufacturers providing OEM type equipment will depend on the OEM to set the serial number.

Since the serial number is within a particular domain or name space based on manufacturer, it is possible though improbable that different manufacturers may have used the same serial number so you would really need to know both manufacturer as well as serial number.

Some point of sale terminals are consistent about the serial number and part of the procedure for mother board replacement in the case of a failed mother board is to set the serial number of the replacement board to the serial number of the board being replaced. This implies that someone could have the same serial number for several pieces of equipment similar to doing LAN NIC MAC spoofing.

The WMI query will make a difference as to the serial number provided. In addition to the serial number there is also an asset tag property as well.

Looking at the documentation for Win32_MotherboardDevice and trying a few properties, there does not seem to be much useful data there, certainly not something similar to a unique serial number.

On a Dell laptop With Windows XP when I run a C++ application that uses WMI to see the results of several different Select WMI queries for several different properties I get the following results:

Connected to ROOT\CIMV2 WMI namespace

Query for SELECT * FROM Win32_SystemEnclosure
  SMBIOS SerialNumber: 49495G1
  SMBIOS Name: System Enclosure
  SMBIOS SMBIOSAssetTag:
  SMBIOS Manufacturer: Dell Inc.

Query for SELECT * FROM Win32_BaseBoard
  SMBIOS SerialNumber: .49495G1.CN486438441035.
  SMBIOS Product: 0UY141
  SMBIOS Name: Base Board
  SMBIOS Manufacturer: Dell Inc.

Query for SELECT * FROM Win32_BIOS
  SMBIOS SerialNumber: 49495G1
  SMBIOS Name: Phoenix ROM BIOS PLUS Version 1.10 A10
  SMBIOS Manufacturer: Dell Inc.

Query for SELECT * FROM Win32_ComputerSystem
  SMBIOS Name: CIT-31204E1FF03
  SMBIOS Manufacturer: Dell Inc.

Query for SELECT * FROM Win32_ComputerSystemProduct
  SMBIOS Name: Latitude D830
  SMBIOS IdentifyingNumber: 49495G1
  SMBIOS UUID: 4C4C4544-0039-3410-8039-B4C04F354731

Looking on the bottom of this laptop I see a sticker that has a bar code along with printing that says "SERVICE TAG 49495G1" so for this laptop the serial number retrieved is the service tag identifier. I can go to the Dell website and look up this service tag in the support area.

A new point of sale terminal meant for resale with POS Ready 7 version of Windows provides the following output with the same C++ WMI application. This is similar to the output from a PC I constructed myself from purchased parts which also did not have serial numbers That PC is running Windows 8.1.

Connected to ROOT\CIMV2 WMI namespace

Query for SELECT * FROM Win32_SystemEnclosure
  SMBIOS SerialNumber: None
  SMBIOS Name: System Enclosure
  SMBIOS SMBIOSAssetTag: None
  SMBIOS Manufacturer: To Be Filled By O.E.M.

Query for SELECT * FROM Win32_BaseBoard
  SMBIOS SerialNumber: None
  SMBIOS Product: EIN70-SAM
  SMBIOS Name: Base Board
  SMBIOS Manufacturer: INTEL Corporation

Query for SELECT * FROM Win32_BIOS
  SMBIOS SerialNumber: None
  SMBIOS Name: BIOS Date: 10/15/13 20:06:15 Ver: 04.06.05
  SMBIOS Manufacturer: American Megatrends Inc.

Query for SELECT * FROM Win32_ComputerSystem
  SMBIOS Name: GENPOSA-1
  SMBIOS Manufacturer: To be filled by O.E.M.

Query for SELECT * FROM Win32_ComputerSystemProduct
  SMBIOS Name: EIN70-SAM
  SMBIOS IdentifyingNumber: None
  SMBIOS UUID: 03000200-0400-0500-0006-000700080009

这篇关于主板ID - WMI C ++ - 可靠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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