windows – 查找硬件制造商,型号和序列号?

我想通过软件解决方案找到各种 Windows(XP,Vista,2003,2008)和 Linux(Ubuntu,Debian,Fedora)机器的制造商,型号和序列号.

目前我们的硬件库存已过时,因此我希望通过软件解决方快速获取此信息(因此我无需每台计算机都可以阅读贴纸).

我想编写这样的脚本,理想情况下它不需要任何第三方应用程序,如果它理想情况下它是独立的,因此它很容易移植.

知道如何做到最好吗?如果有一个预构建的(免费)解决方案,理想情况下,我希望它报告原始文本或MySQL数据库.理想情况下,这是一个独立的小工具,我不想在每台PC上安装东西.如上所述,我非常高兴使用预构建的OS工具编写脚本.我知道这是可能的,因为我已经看到其他应用程序报告此信息(尽管在大量批量包中包含其他我不需要的东西,例如Spiceworks).

对于Windows,您可以使用快速PowerShell脚本来包装WMI,如下所示:
function Get-Inventory([string] $computer = '.')
{
    $data = ""|select name,vendor,model,serial
    $bios = get-wmiobject 'win32_BIOS' -computername $computer
    $comp = get-wmiobject 'win32_computersystem' -computername $computer
    $data.name = $comp.Name
    $data.vendor = $comp.manufacturer
    $data.model = $comp.Model
    $data.serial = $bios.SerialNumber
    return $data
}

如果您提供列出所有计算机的文本文件,如下所示:

get-content 'mycomputers.txt' | foreach-object{Get-Inventory}

你将得到一个很好的计算机和硬件细节表.如果需要归档数据,请使用export-csv cmdlet将输出直接转储到文件.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...