Windows – Finding hardware manufacturer, model and serial number

asset-managementwindows

I'd like to find the manufacturer, model and serial number of various Windows (XP, Vista, 2003, 2008) and Linux (Ubuntu, Debian, Fedora) machines via a software solution.

Currently our hardware inventory is out of date, so I'd like a quick rapid way to get this information via a software solution (so I don't need to approach every single computer to read the sticker).

I'd like to script this so ideally it wouldn't require any 3rd party applications, if it does ideally it'd be stand alone so it's easily portable.

Any idea to how this could be done best? If there's a pre-built (free) solution ideally I'd like it reporting to either raw text or a MySQL database. Ideally a small stand alone tool, I don't want to be installing stuff on each PC. As mentioned above though, I'm perfectly happy to script this using prebuilt OS tools. I know this is possible as I've seen other apps reporting this information (although in massive bulk packages with other stuff I don't need e.g. Spiceworks).

Best Answer

For Windows, you could use a quick powershell script to wrap up WMI, something like this:

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
}

If you feed that a text file listing all your computers, like this:

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

you will end up with a nice table of computers and hardware details. If you need to archive the data, use the export-csv cmdlet to dump the output straight to a file.