Developing WMI Solutions: A Guide to Windows Management Instrumentation

Paperback
from $0.00

Author: Craig Tunstall

ISBN-10: 0201616130

ISBN-13: 9780201616132

Category: Windows 2000

"Craig and Gwyn bring their insight and experience with WMI to explain how easy it is to write powerful management applications through WMI on the .NET platform."\ —Andy Cheung, Microsoft WMI Test Engineer\ Windows Management Instrumentation (WMI) is an impressive technology that provides, for the first time, an integrated approach to hardware and software management for the Windows operating system. Developing WMI Solutions gives administrators and developers the skills necessary to take...

Search in google:

Developers and system administrators will find this text useful both for instruction in using WMI and as a reference for advanced techniques. Initial chapters introduce concepts, terminology, the uses of the unified management standard WBEM, and its characteristics. The installation and components of WMI, its interactions with subsystems, query language facilities, class schemas, method design, developing management and .NET management applications, MMC Snap-ins, scripts, providers, and high-performance instrumentation are some of the other topics covered. Annotation c. Book News, Inc., Portland, OR

Windows Management Instrumentation (WMI) is an impressive technology. For the first time the Windows operating system employs a unified technology to represent software and hardware management. The power of WMI in systems management stretches virtually to every piece of software and hardware. So regardless of whether you're a team leader, software engineer, or system administrator, WMI will probably affect you.\ Many applications written for Windows currently do not harness the power of a systems management technology such as WMI: This is why we wrote this book. We want developers to realize that making an application manageable is a key benefit, especially to system administrators. Once system administrators and Information Technology (IT) support departments realize what can be done with WMI, they will demand that applications expose WMI management interfaces. Not only will system administrators be happy, but you'll also be able to harvest the wealth of information available from WMI when building your own management applications. The other side of the coin, apart from making an application manageable, is a "management application." A management application is a program (like an MMC snap-in) or Web interface that can interact with the system to gather, inspect, and manipulate the system's functionality or configuration. We also want system administrators to realize what they can do in a system equipped with a technology such as WMI and how they should go about automating routine tasks.\ We are both very excited about WMI and hope to spread the word to help the computing world become a more managed place.\ Who Is This Book for and What Is WMI?\ This book helps developers and system administrators understand Windows Management Instrumentation (WMI). WMI is a technology built into Windows that enables organizations to manage servers and user PCs connected to their networks. Systems management is becoming much more important as organizational networks become more complex. Systems management is not necessarily a new concept as existing protocols like Simple Network Management Protocol (SNMP) and Desktop Management Interface (DMI) have been around for a while. What is new is that it's been traditionally difficult to envisage a unified picture of the whole system.\ Understanding the relationships between hardware and software in an organization's network is equally important. The SNMP world took systems management only as far as the hardware, such as routers. The DMI world took systems management only as far as the desktop. This led to the definition of Web Based Enterprise Management (WBEM), a protocol/schema, by the Distributed Management Task Force (DMTF). Microsoft adopted WBEM and WMI was born. WMI is an implementation of the WBEM standard that is consistent with Microsoft's Total Cost of Ownership (TCO) initiative. WMI brings the power of managing a Windows network to unprecedented levels. For example, through WMI a system administrator can easily write a script that will identify the Windows service packs that have been installed on all the machines in the network.\ Administrators can easily develop scripts to perform routine tasks for their network, as well as exploit powerful notification facilities inherent within WMI to identify problems before their users experience them. For this level of system manageability to be made possible, the operating system, devices, and application software need to be instrumented—hardware and software need to expose their management interface through WMI. Hence, for developers, this book is important in learning how to do this; for administrators, it is important in learning how to exploit this technology that helps lower the TCO; and it is important to software team leaders in understanding the impact of this new management model on development.\ How to Approach This Book and What You Will Learn\ Developers and system administrators, the primary target audience for this book, will benefit from it in several ways. If you know nothing about systems management or WMI, don't worry—this book will help you develop your skills and knowledge of WMI from the beginning. We also intend for this book to be a reference, so if you want to develop a WMI provider in C++ to expose your software management interface, you can go directly to Chapter 12. Likewise, if you want to get system management information in your .NET application, you can go to Chapter 8. Let's have a quick round-up of each chapter.\ Chapter 1: Introduction\ This chapter introduces the various concepts and terminology used in systems management, in particular, WMI. The chapter highlights the necessity for a unified management standard such as WBEM.\ Chapter 2: Existing Management Frameworks\ This chapter aims to introduce the goals of WBEM and systems management by examining two existing management frameworks, SNMP and DMI. Still in widespread deployment, both are introduced thoroughly from an architectural perspective and provide an introduction to the basic principles and rationale behind systems management prior to WBEM. The chapter ends by summarizing the characteristics considered desirable in a management framework and how they relate to WBEM.\ Chapter 3: Windows Management Instrumentation\ This chapter covers a lot of ground to bring you up to speed with WMI. It covers installation and the various components that make up the WMI toolset. It contains some detailed information on the WMI architecture and the various interactions between WMI subsystems. It introduces essential WMI vocabulary so that you can understand the WMI features from a high-level perspective. The latter part of the chapter introduces some of WMI's powerful query language facilities, including queries for data (management information), queries for events (notification of activity), and queries against the class schema (understanding relationships between management information).\ Chapter 4: A Guided Tour of the Common Information Model Repository\ The chapter continues to help you understand the various class schemas and the WMI tools provided by Microsoft. The class schemas describe virtually every aspect of a network, a computer, and its operating system, as well as the installed software. The chapter includes an in-depth tutorial that provides an extensive introduction to the skills you will need as either an administrator or a developer using the Common Information Model (CIM). The chapter also covers in detail how all the WMI building blocks fit together. It introduces namespaces, classes, properties, qualifiers, flavors, and associations.\ Chapter 5: Developing Class Schemas\ From a development point of view, a class schema is the most important place to start to use a standard management environment to manage your own software and hardware. Chapter 5, the first of two chapters in which we discuss this, also is applicable to system administrators who wish to understand more about interpreting a WMI class schema (perhaps for an administration script or simply to obtain information from a user's PC). The chapter introduces schema design by approaching a case study from a project life-cycle perspective that discusses all the stages of the class schema development/design and offers lots of advice and tips along the way, right through to deployment.\ Chapter 6: Method Design and Schema Class Positioning\ Chapter 6 continues to develop the case study begun in Chapter 5, focusing on interpreting and approaching subtle differences in schema design, such as whether to use a particular method or the WMI standard mechanism to create a management object. It offers advice about looking toward future management requirements in designing classes and their positions within the schema, on localizing schema, and on a number of other topics.\ Chapter 7: Developing Management Applications\ Accessing the WMI management environment can be achieved in a number of ways. The first of the development-oriented chapters is aimed primarily at developers who need to use C++ and the Component Object Model (COM) to obtain and manipulate information in the management environment. Consider this example, one of the many reasons that you might want to do this: You need access to the management environment so that you can develop a tool, perhaps a user interface administration console, to manage your application's configuration. The chapter contains useful and concise code samples to demonstrate how easy it is to use WMI. It also discusses a number of topics, including event notification, security, and accessing high-performance classes.\ Chapter 8: Developing .NET Management Applications\ This chapter is on a similar level to Chapter 7, but focuses on how to use the classes in the .NET Framework using C#. The .NET Framework from Microsoft effectively is a new execution environment for applications. C# is a new programming language, ultimately designed to leverage developer productivity. Through the code samples, you'll see how easy the .NET Framework makes management applications development. Virtually every class in the .NET Framework is discussed in detail.\ Chapter 9: Developing MMC Snap-ins\ The Microsoft Management Console (MMC) is Microsoft's response to the need for a consistent user interface in which administrators can find all their management tools. The facility to have a similar look and feel across the administrative user interface and the fact that all administration tools can be found in one place mean that MMC helps administrators move toward a lower cost of ownership. This tutorial-style chapter follows the C++ and COM developer through each stage of MMC snap-in development. By the end of the chapter, you will see how to use WMI to access and manipulate Windows Services in a user interface designed for administration. One of MMC's most powerful features is the capability to develop and extend other snap-ins to add your own administration facilities.\ Chapter 10: Developing WMI Scripts for Administrators\ This chapter is the first of two aimed primarily at the system administrator. It assumes that you have very little, if any, experience in writing scripts and therefore starts at the beginning. It introduces the tools available for system administration and progresses to the VBScript boot camp. The boot camp introduces different types of problems you might experience and the techniques used to solve them. It gives detailed instructions for installing the Windows Scripting Host to enable you to use the chapter's sample scripts. By the end of the chapter, you'll learn how to develop your own scripts to use WMI to access and manipulate the management environment.\ Chapter 11: WMI Scripting and WMIC\ This chapter builds on the lessons learned from Chapter 10. From a systems management perspective (using a case study), you learn how to break down administration problems and solve them using the scripting approach. It discusses remote script execution, because organizational networks contain networked PCs. Windows Management Instrumentation Command-line (WMIC), a new command-line tool that allows administrators to execute tasks and queries against the management environment, exists in Windows XP. The chapter examines WMIC in detail and provides a framework that would be useful for solving problems quickly using WMIC. There's also advice on a number of topics, including how to debug scripts.\ Chapter 12: Developing WMI Providers\ This crucial chapter describes how software and hardware developers can write their own WMI providers, the gateway for developers to expose their own class schema. The chapter assumes that you have development skills in C++ and COM. It covers virtually all of the many types of providers that can be developed. The chapter implements a very simple fruit basket WMI instance provider in the beginning and progresses to method, event, permanent event consumer, property, and push providers. This chapter provides a solid grounding in developing WMI providers. The source code accompanying the book contains a WMI provider ATL-like framework for accelerating your provider development, although the chapter does not explicitly discuss it.\ Chapter 13: High-Performance Instrumentation\ Finally, the book covers event tracing, a very little-known subject of the WMI toolset. Event tracing is a powerful and high-performance method of instrumenting applications. It allows applications to expose very detailed information about an operation or task. The operating system uses this technology to expose activity in the Windows kernel, security subsystems, and numerous other subsystems.\ Where Can I Find the Sample Source Code and Scripts?\ All the source code and scripts can be found at http://www.wbem.co.uk/, the Web site that accompanies the book. This includes the MOF files, Visual C++ 6.0 projects, Visual Studio .NET projects, and the VB Scripts. The projects for the sample code from Chapters 7 and 8 contain many more short functions to demonstrate various aspects of accessing WMI. Check the sample projects if you're not sure how to do something that is not explicitly covered by the chapters.\ Glossary\ New terms and acronyms are introduced throughout the book. The glossary summarizes these at the end of the book.

PrefaceCh. 1Introduction1Ch. 2Existing Management Frameworks25Ch. 3Windows Management Instrumentation59Ch. 4A Guided Tour of the Common Information Model Repository99Ch. 5Developing Class Schemas155Ch. 6Method Design and Schema Class Positioning207Ch. 7Developing Management Applications267Ch. 8Developing .NET Management Applications347Ch. 9Developing MMC Snap-ins405Ch. 10Developing WMI Scripts for Administrators493Ch. 11WMI Scripting and WMIC545Ch. 12Developing WMI Providers593Ch. 13High-Performance Instrumentation669App. A735App. B745Glossary759Bibliography767Index769