Skip to content

Building Workstation Inventory

2010 April 4

Do you currently have or need an inventory of devices on your network, including every detail about these devices? Well, if you have windows running on your workstations, then powershell could be of use. Powershell is now a built-in feature in Windows 7 and Server 2008R2, telling me it will be the standard for running custom data mining and management scripts.

Powershell gives you an object oriented scripting language that allows for easy manipulation of data, for example where we are talking about getting device info, we can create a new WMI object that contains all the data about a computers BIOs very easily.

PS C:\Documents and Settings\sysjared> $objBIOS = get-wmiobject -class Win32_BIOS
PS C:\Documents and Settings\sysjared> $objBIOS

SMBIOSBIOSVersion : A08
Manufacturer      : Dell Inc.
Name              : Phoenix ROM BIOS PLUS Version 1.10 A08
SerialNumber      : 6XR4871
Version           : DELL   – 7
SMBIOSBIOSVersion : A08
Manufacturer : Dell Inc.
Name : Phoenix ROM BIOS PLUS Version 1.10 A08
SerialNumber : 6XR3476
Version : DELL   – 7

So as you can see, we can get a great deal of details using powershell and the builtin WMI object cmd-lets. We now have a way to get our computer details, the next step is how can we store this data? Well in my case I decided to use the MySQL .net connector which I have outlined in a previous post, and have created a database to be my device inventory. Now all you have to do is put a nice face on this database, I used cakePHP to quickly deploy a simple management and inventory web interface.
No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS