Developing WMI Solutions: A Guide to Windows Management Instrumentation

Developing WMI Solutions: A Guide to Windows Management Instrumentation

ISBN-10:
0201616130
ISBN-13:
9780201616132
Pub. Date:
11/28/2002
Publisher:
Addison-Wesley

Paperback - Rent for

Select a Purchase Option
  • purchase options

Temporarily Out of Stock Online


Overview

Developing WMI Solutions: A Guide to Windows Management Instrumentation

"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

    Product Details

    ISBN-13: 9780201616132
    Publisher: Addison-Wesley
    Publication date: 11/28/2002
    Series: Addison-Wesley Microsoft Technology Series
    Pages: 789
    Product dimensions: 7.16(w) x 8.97(h) x 1.81(d)

    Table of Contents

    Preface.

    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.

    The World Wide Web Consortium.

    Web-Based Enterprise Management.

    Windows Management Instrumentation.

    Common Information Model.

    Common Information Model Repository.

    Managed Object Format.

    Simple Network Management Protocol.

    Common Management Information Services.

    Common Management Information Protocol.

    Desktop Management Interface.

    eXtensible Markup Language.

    Hypertext Transfer Protocol.

    Extended Schemas.

    WMI Scripting.

    Summary.

    Ten Fast Facts: Web Based-Enterprise Management.

    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.

    The Standard WBEM Components.

    Installing WMI.

    Installation files.

    Configuring Windows 98 for WMI.

    Core Components of WMI.

    WinMgmt.exe: The Windows Management Service.

    mofcomp.exe: The Microsoft MOF Compiler.

    The WMI Control.

    Windows Management Instrumentation Tester.

    Automatic MOF Registration.

    WMI Log Files.

    WMI CIM Repository.

    Windows Management Instrumentation.

    The Basic Framework of WMI.

    WMI management applications.

    Direct Access.

    Indirect Access.

    Providers.

    Types of Providers.

    Event Providers.

    Data Providers.

    Event Handling.

    Intrinsic Events.

    Extrinsic Events.

    Timer Events.

    Event Consumer.

    Temporary Consumers.

    Permanent Consumers.

    WMI Security.

    WMI Permission Assignment Using WMI Control.

    The WMI Query Language.

    Data Queries.

    Event Queries.

    Schema Queries.

    Summary.

    Ten Fast Facts: 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.

    The Core Model.

    The Common Model.

    The Extended Schemas.

    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.

    Managed Object Format.

    MOF Class Declaration.

    Qualifiers.

    Flavors.

    Custom Qualifiers.

    User-Defined Qualifiers.

    Intrinsic Data Types.

    Instance Creation.

    Aliasing.

    A Compileable MOF File.

    ActiveX Components.

    Let the Tour Begin!

    The Class Explorer Explained.

    Associations.

    Key Propagation.

    Namespaces and Associations.

    System Properties.

    Object and Property Qualifiers.

    CIM Studio Functions.

    Help for a Class.

    Browse for a Namespace.

    Search for a Class.

    Instance Enumeration.

    Change the View (System Properties and Inherited Properties).

    WQL Queries Tool.

    Add a Class.

    Create an Association.

    Delete a Class or Association.

    Delete a Property.

    Add an Instance.

    Delete an Instance.

    Places of Interest within the CIM Repository.

    The Provider Classes.

    The Namespace Classes.

    Create a Namespace.

    Delete a Namespace.

    Tutorial: Creating a Namespace and Adding Classes, Properties, and an Association.

    The Wizards.

    The MOF Generator.

    The MOF Compiler.

    The Provider Code Generator.

    Summary.

    Ten Fast Facts: CIM Repository.

    5. Developing Class Schemas.

    Who is the chapter for?

    Schema Design and System Manageability.

    Case study: Client/Server Email Package.

    Basic Functionality.

    System Requirements for Post Office Email System.

    The Unified Modeling Language.

    Further Reading in UML.

    Learning the CIM Schema and Win32 Extended Schemas.

    Psychological Requirements.

    Schema Design Timescales.

    Software Application Life Cycle.

    The Windows Installer and WMI.

    The Role of WMI with Standard Software Applications and Management Software Applications.

    Schema Design by Teams vs. Single Developers.

    When Should I Commit My Design to UML?

    Can I Design a Schema without UML?

    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.

    Basic Rules for Schema Design.

    WMI Topology Design.

    First approach.

    Second approach.

    Schema Design Phase.

    Step 1: Gather Information.

    Step 2: Define System Requirements, Rules and Assertions.

    Step 3: Define Classes and Properties.

    Step 4: Define Associations.

    Representing the PostOffice Schema in UML.

    Conclusion.

    Ten Fast Facts: Starting Schema Design Tips.

    6. Method Design and Schema Class Positioning.

    Properties vs. Methods.

    Methods, Operations and Functions.

    Step 5: Define Methods.

    Candidate Methods.

    Method Arguments.

    Method Overriding and Polymorphism.

    The Post Office Schema Methods.

    Method AddUser.

    Method RemoveUser.

    Method UnlockAccount.

    Method LockAccount.

    Method StopPostOffice.

    Method StartPostOffice.

    PostOffice Schema UML Diagram with Methods.

    Output.

    Step 6: Check Schema Design.

    Input.

    Rule Generation-Based UML Diagrams.

    Final Considerations—Future Additions.

    Final Step: Positioning Classes.

    Step-by-Step CIMV2 Namespace Class Positioning.

    Extending the CIMV2 Namespace.

    Normalization.

    CIMV2 Class Placement Objectives.

    Putting Class Placement Theory into Practice.

    Namespace and Schema Placement.

    The Applications Namespace.

    Limitations of Multinamespace Class Positioning.

    Post Office Schema Namespace Positioning.

    The Post Office Schema Class Positions.

    Managed Object Format (MOF) Qualifiers and Flavors.

    MOF Creation and Testing.

    Implementing the Schema: WMI API Calls vs. MOF code.

    Multi-language support.

    The Post Office Schema in MOF.

    Compiling a Multilanguage MOF File.

    Testing.

    Schema Deployment.

    Summary.

    Schema Design and Positioning Q&A.

    7. Developing Management Applications.

    Getting Started.

    Object Paths Explained.

    Getting an Object.

    Enumerating Objects.

    Creating an Object.

    First Point.

    Second Point.

    Third Point.

    Example.

    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.

    Ten Fast Facts: Developing C++/COM Management Applications.

    8. Developing .NET Management Applications.

    Getting Started.

    Getting a Management Object.

    Enumerating Management Objects.

    Creating a Management Object.

    First Point.

    Second Point.

    Third Point.

    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.

    Ten Fast Facts: Developing .NET Management Applications.

    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.

    Ten Fast Facts: Developing MMC Snap-ins.

    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.

    Ten Fast Facts: Summary of VBScript boot camp.

    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.

    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.

    Candidate Constants.

    Candidate Variables.

    Determine the Sequence of Steps in the Task.

    Script Deployment and Execution.

    Local Execution and Storage.

    Local Execution from a Shared Resource.

    Remote Connection across a Network.

    Remote Invocation of a Script (Available Only with Windows Script v5.6).

    Script Execution Methods.

    Executing Scripts at Start Up.

    Execute the Script Using the Windows Scheduler.

    Event-driven Script Execution (Windows XP Only).

    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 Non-Interactive Mode.

    Summary.

    Ten Fast Facts: WMIC Tips.

    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.

    Ten Fast Facts: Developing WMI Providers.

    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.

    Defining the Event Class Schema.

    Registering an Application as an Event-Tracing Provider.

    Developing the Provider's Control Call-Back Function.

    Producing an Event Trace.

    Producing a Hierarchical Event Trace.

    Analyzing Event-Trace Log Files.

    Processing an Event-Trace Log File.

    The Event Call-Back Function.

    The Buffer Call-Back Function.

    The Consumer Event-Tracing APIs.

    Monitoring Real-Time Event-Tracing Sessions.

    Providing and Analyzing Lightweight Events.

    Analyzing lightweight events.

    Summary.

    Ten Fast Facts: High Performance Instrumentation.

    Appendix A.

    Appendix B.

    Glossary.

    Bibliography.

    Index. 0201616130T10172002

    Customer Reviews

    Most Helpful Customer Reviews

    See All Customer Reviews