Updating System Inventory Databases

Downloads
45824.zip

\[Editor's Note: Share your scripting discoveries, comments, problems, solutions, and experiences with products. Email your contributions (500 words or less) to r2rwinscriptsol@windowsitpro.com. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.\]

My company has a large system inventory database that often needs updating and correcting. Manually checking more than 75 servers is tedious, so I wrote the SystemInventory.vbs script to obtain system information about servers in our environment. Listing 1 shows an excerpt from SystemInventory.vbs. You can download the full script from the Windows Scripting Solutions Web site. (Go to http://www.windowsitpro.com/windowsscripting, enter 45824 in the InstantDoc ID text box, then click the 45824.zip hotlink.)

As Listing 1 shows, SystemInventory.vbs uses Windows Management Instrumentation (WMI) to report on more than 400 system objects from 11 Windows classes: BIOS, BootConfiguration, ComputerSystem, ComputerSystemProduct, DiskDrive, DiskPartition, DisplayConfiguration, NetworkAdapter, NetworkAdapterConfiguration, OperatingSystem, and Processor. The script creates a Microsoft Excel worksheet that contains important information from each of these classes. SystemInventory.vbs saves the Excel spreadsheet that it creates to C:\~COMPUTERNAME.xls, where COMPUTERNAME is the name of the computer you're querying. The script requires Excel on the computer from which you run the script and WMI on the system you're checking. (Windows 2000 and later includes WMI.)

SystemInventory.vbs uses a simple Web input form that accepts the server's name, user credentials (i.e., Domain\UserID), and a masked password. Listing 2 shows the code for this form. You can use the IP address instead of the server name if name resolution is unavailable. If you need to authenticate to another domain or need to use different credentials, enter the domain name, a backslash, and the user ID and associated password. Otherwise, just enter the server name or IP address and click OK. If you leave the server name blank, SystemInventory.vbs queries the local machine.

You need Administrator rights to run SystemInventory.vbs. In addition, SystemInventory.vbs and SystemInventory.htm need to reside in the same folder. To stop SystemInventory.vbs from running, click the X on the Web input form's title bar to close the form. SystemInventory.vbs includes minimal error-checking code; if the computer that you're querying doesn't exist or doesn't have WMI installed, the script ends.

Discuss this Article 2

KEVIN (not verified)
on Apr 19, 2005
script appears corrupt.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.