Hardware information

Introduction
Windows Management Instrumentation (WMI) is a scalable system management infrastructure that uses a single, consistent, standards-based, extensible, object-oriented interface. WMI provides you with a standard way to interact with system management information and the underlying WMI APIs. WMI is used primarily by system management application developers and administrators to access and manipulate system management information.


The purpose of WMI is to provide a standardized means for managing your computer system, be it a local computer or all the computers in an enterprise. In its simplest terms, management is little more than collecting data about the state of a managed object on the computer system and altering the state of the managed object by changing the data stored about the object. A managed object can be a hardware entity, such as a memory array, port, or disk drive. It can also be a software entity, such as a service, user account, or page file.

WMI can manage the many components of a computer system. In managing a hard disk, you can use WMI to monitor the amount of free space remaining on the disk. You could also use WMI to remotely alter the state of the drive by deleting files, changing file security, or partitioning or formatting the drive.

WMI is not only a powerful tool to collect system information, it is also very easy to use. Existing scripting WMI interface makes it possible to be used for system administrators and web-designers as well as for skilled programmers.

Hardware information
Presented application displays hardware information in HTML page and uses VBScript as back-end programming language.
First of all, we set strComputer (name of the computer to get information from) to "." - current computer, and write function GetWMIServices() - this function will be used in all procedures that get information from WMI and can be modified to get WMI services from another computer.
Then we define some function that will format output - WMIDateStringToDate(), DisplayOutputHeader(), DisplayOutput(), GetTableHeader(), GetTableFooter(), GetRow(). With these functions, we will have standardized output.
For example, the code for retrieving and displaying processor(s) information is:
CODES:
HardwareInfo retrieves also information about baseboard, batteries, BIOS, memory settings, PnP devices, ports and some others.

At the last point, customize look of the application with cascading style sheet - the easiest way to create good looking interface. Application can run as is - just double-click on index.hta file or it can be compiled into single file. Retrieving information about installed hardware items with Windows Management Instrumentation is very easy and requires minimal programming skills.

HardwareInformation application is written as HTA (HTML application) and compiled with compiler provided withwww-Sharp.ClrHost that is available for free. www-Sharp includes WMI viewer that can be used to visually explore WMI classes and properties and write powerful WMI applications.

No comments:

Post a Comment