Book description
"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 advantage of the power of WMI with Windows 2000, XP, and .NET Server.
Developing WMI Solutions starts with an overview of the concepts behind systems management. The authors then provide a synopsis of existing management architectures, as well as an explanation of the architectural components of WMI and the tools provided by Microsoft for their use. Also included is a WMI scripting boot camp for administrators using samples in VBScript, plus a series of best practices that give scripts a professional edge.
You will find thorough coverage of such topics as:
The Common Information Model (CIM)
Developing CIM extended schemas
Management-application development using C++ and COM for WMI
MMC snap-in development using C++ and COM, presented as a tutorial
WMI providers and the necessary C++ and COM skills needed to expose class schema
Developing management applications using the .NET Framework—the first comprehensive guide to the WMI classes in the System.Management namespace
Finally, developers will learn about the often undersold but extremely powerful high-performance event-tracing mechanism available in Windows, which allows developers to expose detailed information about operations in an application.
The companion Web site, located at http://www.wbem.co.uk, includes the complete set of code examples found in the book, as well as updates and related articles.
Both a tutorial and a reference, Developing WMI Solutions is an essential companion for network administrators, software developers, and team leaders looking to become proficient with WMI.
0201616130B10072002
Table of contents
- Copyright
-
Preface
- Who Is This Book for and What Is WMI?
-
How to Approach This Book and What You Will Learn
- Chapter 1: Introduction
- Chapter 2: Existing Management Frameworks
- Chapter 3: Windows Management Instrumentation
- Chapter 4: A Guided Tour of the Common Information Model Repository
- Chapter 5: Developing Class Schemas
- Chapter 6: Method Design and Schema Class Positioning
- Chapter 7: Developing Management Applications
- Chapter 8: Developing .NET Management Applications
- Chapter 9: Developing MMC Snap-ins
- Chapter 10: Developing WMI Scripts for Administrators
- Chapter 11: WMI Scripting and WMIC
- Chapter 12: Developing WMI Providers
- Chapter 13: High-Performance Instrumentation
- Where Can I Find the Sample Source Code and Scripts?
- Glossary
- Acknowledgments
-
1. Introduction
- Structure of the Book
- Pedagogical Elements
- Target Audience
- Prerequisites
- Terminology
- Software Requirements
- Operating System Requirements
- Hardware Requirements
- Introducing WBEM
- WBEM's Basic Objectives
- Core Objectives
- The Central Information Store
- The Common Information Model
- Object Orientation and CIM
- Building an Information Model
- Structure of the Centralized Repository
- The Three-Tiered Model
- Acronyms and Terminology
- Standards Bodies
- Motivation
- De Facto and de Jure Standards
- The Distributed Management Task Force (DMTF)
- The World Wide Web Consortium (W3C)
- Web-Based Enterprise Management (WBEM)
- Windows Management Instrumentation (WMI)
- Common Information Model (CIM)
- Common Information Model (CIM) Repository
- Managed Object Format (MOF)
- Simple Network Management Protocol (SNMP)
- Common Management Information Services (CMIS)
- Common Management Information Protocol (CMIP)
- Desktop Management Interface (DMI)
- eXtensible Markup Language (XML)
- Hypertext Transfer Protocol (HTTP)
- Extended Schemas
- WMI Scripting
- Summary
-
2. Existing Management Frameworks
- New and Old Technologies Combined
- The Need for a Universal Management Model
- The Simple Network Management Protocol
- A Simple Solution to a Complex Problem
- The SNMP Network Management Station
- Relevant SNMP Standards
- Structure of an SNMP Message
- Communities
- Event Notification: SNMP Traps and Informs
- The Management Information Base
- SNMP Security
- Modus Operandi
- Advantages of the SNMP Protocol
- Disadvantages of the SNMP Protocol
- The Desktop Management Interface
- The DMI Information Model: The Management Store
- Policy
- Notification of Events
- DMI Security
- MIF Database Security
- Management Interface Security
- Component Interface Security
- Security Indications
- Advantages of the DMI
- Disadvantages of the DMI
- Summary
- 3. Windows Management Instrumentation
-
4. A Guided Tour of the Common Information Model Repository
- Metadata
- Dynamic and Static Data
- Dynamic Data and the CIM Repository
- The Common Information Model
- Namespaces
- Using the CIMV2 Namespace
- WMI Namespaces and the CIM repository
- Defining and Using Your Own Namespace
- Namespaces and Schemas
- Using Existing Schemas
- Subclassing and Instantiating Existing Classes in the CIMV2 Namespace
- Modifying Existing Classes
- MOF Class Declaration
- Qualifiers
- Flavors
- Custom Qualifiers
- User-Defined Qualifiers
- Intrinsic Data Types
- Instance Creation
- A Compileable MOF File
- ActiveX Components
- Let the Tour Begin!
- The Class Explorer Explained
- System Properties
- Object and Property Qualifiers
- CIM Studio Functions
- Places of Interest within the CIM repository
- Tutorial: Creating a Namespace and Adding Classes, Properties, and an Association
- The Wizards
- Summary
-
5. Developing Class Schemas
- Schema Design and System Manageability
- Case Study: Client/Server E-mail Package
- The Unified Modeling Language
- Learning the CIM Schema and Win32 Extended Schemas
- The Windows Installer and WMI
- Schema Design by Teams vs. by Single Developers
- The Unified Modeling Language in Schema Design
- A Brief Introduction to UML Object Modeling
- Interpreting the Common Model in UML
- The Schema Design Road Map
- WMI Topology Design
-
Schema Design Phase
- Step 1: Gather Information
- Step 2: Define System Requirements, Rules, and Assertions
-
Step 3: Define Classes and Properties
- Input
- Name Your Schema
- MOF Qualifiers
- Define Candidate Classes
- Define Events
- Intrinsic Event Filter Example
- Define Statistical Classes
- Define Settings Classes
- Define Properties
- Class PO_PostOffice
- Discussion
- A Brief MOF Interlude
- MOF Language Tip
- Class PO_PostOfficeSettings
- Class PO_UserDetails
- Discussion
- Class PO_EmailAccount
- Discussion
- Class PO_Mailbag
- Discussion
- Class PO_MessageSettings
- Step 4: Define Associations
- Representing the PostOffice Schema in UML
- Summary
-
6. Method Design and Schema Class Positioning
- Properties vs. Methods
- Methods, Operations, and Functions
- Step 5: Define Methods
- Step 6: Check Schema Design
- Final Step: Positioning Classes
- Step-by-Step CIMV2 Namespace Class Positioning
- Putting Class Placement Theory into Practice
- Namespace and Schema Placement
- The Applications Namespace
- MOF Creation and Testing
- Implementing the Schema: WMI API Calls vs. MOF Code
- Multilanguage Support
- The Post Office Schema in MOF
- PO_PostOfficeHasSettings MOF File
- Testing
- Schema Deployment
- Summary
-
7. Developing Management Applications
- Getting Started
- Object Paths Explained
- Getting an Object
- Enumerating Objects
- Creating an Object
- Updating Objects
- Deleting an Object
- Performing Queries
- Making Method Calls
- Manipulating Object Properties
- Manipulating Array Object Properties
- Accessing Objects from Object Properties
- Making Semisynchronous Calls
- Making Asynchronous Calls
- WMI Error Messages
- Overview of Events
- Intrinsic Events
- Extrinsic Events
- Timer Events
- How to Subscribe to Events
- Writing Applications to Receive Semisynchronous Events
- Writing Applications to Receive Asynchronous Events
- More on Security
- Classes that Require Specific Security Privileges
- Localized Namespaces
- Overview of High Performance Classes
- Writing Applications to Access High-Performance Data
- Access High-Performance Enumerated Data
- Summary
-
8. Developing .NET Management Applications
- Getting Started
- Getting a Management Object
- Enumerating Management Objects
- Creating a Management Object
- Updating Management Objects
- Deleting a Management Object
- Performing Queries
- Making Method Calls
- Manipulating Management Object Properties
- Manipulating Array Object Properties
- Accessing Objects from Object Properties
- Making Asynchronous Calls
- Overview of Events
- Writing Applications to Receive Asynchronous Events
- Writing Applications to Receive Semisynchronous Events
- Managing Connections to WMI
- Summary
-
9. Developing MMC Snap-ins
- Snap-in Architecture
- Getting Started
- Snap-in Implementation Basics
- Let's Make a Snap-in
- Implementing IComponentData
- Implementing IComponent
- The Root Item and General Item Basics
- Adding Your Own Namespace Items
- Adding Your Own Columns
- Adding Your Own Result Items
- Setting Up and Handling Verbs
- Adding Your Own Menus
- Adding Your Own Toolbars
- Adding Your Own Property Pages
- Refocusing an Item's Property Sheet
- Adding Your Own Help
- Primary (Standalone) Snap-in Registration
- More on How ATL Delegates Tasks to an Item
- Renaming Items
- Drag and Drop
- Accessing Web Sites
- Displaying Custom Views
- Developing Extension Snap-ins
- Exchanging Information between Primary and Extension Snap-ins
- Extension Snap-in Registration
- Making MMC Snap-ins Theme Aware
- Summary
-
10. Developing WMI Scripts for Administrators
- Scripting, WMIC, and the CIM Studio
- Administration and the WMI CIM Studio
- Administration and the WMIC
- Administration and Scripting
- Guiding Principles
- Prerequisites
- Chapter Structure
- VBScript Boot Camp
- JavaScript vs. VBScript
- Setting Up Your System for Scripting
- Scripting and Administration
- What Is the Windows Scripting Host?
- Scripts
- Scripting vs. Compiled Languages
- The Windows Scripting Host
- Your First Script
- Indentation
- Annotation
- Variants, Variables, and Constants
- Use Meaningful Variable Names
- VBScript Functions
- The WSH Object Model
- Program Statements and Keywords
- The Option Explicit Statement
- Connecting to a Local or Remote Namespace
- Security Issues
- Deciding on the Level of Security Required
- Data Input
- Error Detection
- Error Logging (NT/2000/XP Only)
- WMI Scripting Data Retrieval
- Displaying Date and Time Values (XP Only)
- Retrieving Subsets of Instances
- WMI Data Modification Scripting Example
- Data Deletion Scripting Example
- Data Creation Scripting Example
- Association Traversal Using VBScript
- Executing Methods Using VBScript
- Summary
-
11. WMI Scripting and WMIC
-
Identifying the Correct Course of Action
- Make a Note of the Problem Description
- Divide the Problem into Its Constituent Parts
- Decide Which Hardware or Software Components You Are Going to Manage
- Selecting a Namespace
- Which Tool?
- Decide Whether Your Script Should Run Locally or Remotely on the Target Machines
- Decide Whether Your Script Will Run Unattended or Attended
- Determine the Variables and Constants
- Determine the Sequence of Steps in the Task
- Script Deployment and Execution
- Script Execution Methods
- Sending E-mail
- Setting Up Your System for Debugging and Testing
- Debugging Your Scripts
- Windows Management Instrumentation Command-line (WMIC)
- Using WMIC
- Interactive Mode
- Configuring WMIC
- Interacting with WMIC
- The WHERE Clause
- Verbs
- Adverbs
- Looping WMIC Commands
- Types of Output
- Aliases
- Creating or Modifying Aliases Using the CIM Studio
- Using WMIC in Noninteractive Mode
- Summary
-
Identifying the Correct Course of Action
-
12. Developing WMI Providers
- Where to Start
- Developing an Instance Provider
- Provider Registration
- Provider Initialization
- Enumerating Objects
- Getting an Object
- Deleting an Object
- Creating or Updating an Object
- Querying for Your Objects
- Instance Provider Registration
- Developing a Method Provider
- Executing Methods
- Method Provider Registration
- Developing an Event Provider
- Firing Events
- Event Provider Registration
- Developing an Event Consumer Provider
- Handling Event Notifications
- Permanent Event Consumer Provider Registration
- Developing a Property Provider
- Exposing Dynamic Properties
- Property Provider Registration
- Developing a Push Provider
- Pushing Data to the CIM Repository
- Push Provider Registration
- Security Considerations
- Summary
-
13. High-Performance Instrumentation
- Overview of Event Tracing
-
Controlling Event Traces
- Starting a Kernel Event-Tracing Session
- Setting Up a Session's Configuration
- Querying the Session's Configuration and Statistics
- Stopping the Session
- Starting Event-Tracing Sessions
- Querying for Active Event-Tracing Sessions
- Querying for Registered Event-Tracing Providers
- Starting Private Event-Tracing Sessions
- Developing an Event-Tracing Provider
- Analyzing Event-Trace Log Files
- Monitoring Real-Time Event-Tracing Sessions
- Providing and Analyzing Lightweight Events
- Summary
- A. WMI Event SDK Tools
- B. WMI Server Explorer
- Glossary
- Bibliography
Product information
- Title: Developing WMI Solutions: A Guide to Windows Management Instrumentation
- Author(s):
- Release date: November 2002
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780201616132
You might also like
book
Windows Management Instrumentation (WMI)
Windows Management Instrumentation (WMI) tells readers everything they need to know in order to harness the …
book
VBScript, WMI, and ADSI Unleashed: Using VBScript, WMI, and ADSI to Automate Windows® Administration
If you’re a Windows administrator, scripting expertise can liberate you from boring, repetitive work–so you can …
book
Microsoft® Windows® Registry Guide, 2nd Edition
Visit the catalog page for Microsoft® Windows® Registry Guide, 2nd EditionVisit the errata page for Microsoft® …
book
Windows® Sysinternals Administrator’s Reference
Get in-depth guidance—and inside insights—for using the Windows Sysinternals tools available from Microsoft TechNet. Guided by …