Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

May 10, 2005 12:00 AM

Rem: Retrieving a Computer’s Manufacturing Information

Windows IT Pro
InstantDoc ID #46115
Rating: (0)
Downloads
46115.zip

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.

Retrieving the Manufacturer and SerialNumber properties with a script. ManufacturingInfo.vbs in Listing 2 demonstrates how to use a script to retrieve the manufacturing information for a computer. The code at callout A in Listing 2 is the heart of the script. This code retrieves all instances of the Win32_SystemEnclosure class and stores the collection in the objEnclosures variable. The script then outputs the Manufacturer and SerialNumber properties from each instance of the class. (In this example, there's only one instance.) For more information about the Win32_SystemEnclosure class, go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_systemenclosure.asp.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.