How can I automate the retrieval of a computer's manufacturer and serial number?
The Windows Management Instrumentation (WMI) Win32_System
Enclosure class contains a series of properties related to the physical computer. Depending on the manufacturer, these properties might or might not contain relevant information. On my testing with Dell systems, the Manufacturer and SerialNumber properties contained the correct information. You can use the Windows Management Instrumentation Command-line (WMIC) tool or a script to retrieve these properties.
Retrieving the Manufacturer and SerialNumber properties with WMIC. The WMIC tool, which is available in Windows XP or later, provides a SystemEnclosure alias that makes it easy to retrieve the manufacturing information for a computer. To do this, simply use the following command syntax
wmic /node:computer
systemenclosure
get manufacturer, serialnumber
(Although this command appears on several lines here, you would enter it on one line in the command-shell window.) In this command, computer is the name of the computer you want to check. Although you can specify more than one computer, I don't recommend it. The output doesn't contain the computer names, so it's difficult to match the returned manufacturing information with the computer to which it belongs. If you omit the /node option, WMIC retrieves the information from the local computer. Although WMIC is available only on XP or later, you can still use it to query remote computers running earlier OSs (e.g., Windows 2000) that are running WMI. . . .

