Subscribe to Windows IT Pro

 

Get Newsletters

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

Subscribe Now!

April 11, 2005 12:00 AM

Updating System Inventory Databases

Windows IT Pro
InstantDoc ID #45824
Rating: (1)
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.

Related Content:

ARTICLE TOOLS

Comments
  • KEVIN
    7 years ago
    Apr 19, 2005

    script appears corrupt.

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.