microsoft windows scripting with wmi

400 905 0
microsoft windows scripting with wmi

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info A02LOC622310.fm Page ii Tuesday, September 20, 2005 1:59 PM PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2006 by Ed Wilson All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number 2005933639 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 8 7 6 5 4 3 Distributed in Canada by H.B. Fenn and Company Ltd. A CIP catalogue record for this book is available from the British Library. Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press Inter- national directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to mspinput@microsoft.com. Microsoft, Active Directory, Excel, JScript, Microsoft Press, MSDN, Outlook, Visual Basic, Win32, Windows, Windows NT, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided with- out any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Martin DelRe Project Editors: Melissa von Tschudi-Sutton and Barbara Moreland Technical Editor: Bob Hogan Copy Editor: Christina Palaia Indexer: Julie Bess Body Part No. X11-50076 www.it-ebooks.info A03D622310.fm Page iii Tuesday, September 6, 2005 12:53 PM This book is dedicated to my best friend and wife, Teresa. www.it-ebooks.info A03D622310.fm Page iv Tuesday, September 6, 2005 12:53 PM www.it-ebooks.info v Contents at a Glance Part I Getting Started with WMI/ 1 Introducing WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Configuring WMI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Part II WMI Queries and Events/ 3 Using Basic WMI Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4 Using Advanced WMI Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5 Using WMI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Part III Connect Server and Additional Privileges/ 6 Using the SWbemLocator Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 7 Requesting Additional Privileges for WMI . . . . . . . . . . . . . . . . . . . . . . 139 Part IV Classes/ 8 Understanding WMI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 9 Using Win32 WMI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 10 Using System Hardware Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 11 Using Operating System Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 12 Using the Performance Counter Classes . . . . . . . . . . . . . . . . . . . . . . . . 255 Part V Security and Troubleshooting/ 13 Understanding WMI Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 14 Troubleshooting WMI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 www.it-ebooks.info vi Contents at a Glance Part VI Appendixes/ A Scripting API Methods and Properties. . . . . . . . . . . . . . . . . . . . . . . . . . 313 B WMI Security Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 C WMI Security Privileges and Operations . . . . . . . . . . . . . . . . . . . . . . . . 319 D Computer System Hardware Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 E Operating System Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 F Performance Monitor Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 www.it-ebooks.info A05T622310.fm Page vii Tuesday, September 27, 2005 7:55 AM Table of Contents Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Part I Getting Started with WMI 1 Introducing WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Defining WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Querying and Starting a Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Defining the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Evaluating the State of the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Capturing the Return Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Using WMI as a Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Implementing Microsoft WBEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Describing Objects Using the CIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Working with Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Working with Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Understanding Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Implementing Programming Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Using the WMI Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Using Managed Objects and Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 WMI Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 WMI Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 WBEM Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Retrieving from the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Handing Off to a Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Quiz Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 On Your Own . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Lab 1 Installing and Configuring the Core Platform SDK . . . . . . . . . . . . . . . . 24 Lab 2 Online Install (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Lab 3 Navigating the SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 vii www.it-ebooks.info A05T622310.fm Page viii Tuesday, September 27, 2005 7:55 AM viii Table of Contents 2 Configuring WMI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Understanding the WMI Control Snap-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Configuring Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Backing Up the WMI Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Restoring the WMI Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Changing the Target of Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Understanding Registry Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 LogSecurityFailures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 LogSecuritySuccesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Remote. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Using the CIM Object Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Implementing Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Configuring WMI Service Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Automatically Recovering Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Initial Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Manually Editing the Autorecover MOF Key . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Adding the #pragma autorecover tag to the MOF File . . . . . . . . . . . . . . . . . . 44 Using Mofcomp.exe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Exploring WMI Settings with WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Quiz Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 On Your Own . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Lab 4 Backing Up the WMI Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Lab 5 Restoring the WMI Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Lab 6 Exploring WMI Settings via Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Part II WMI Queries and Events 3 Using Basic WMI Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Understanding WQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Using the Moniker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 The Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 The Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 The Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Using the Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 www.it-ebooks.info A05T622310.fm Page ix Tuesday, September 27, 2005 7:55 AM Table of Contents ix Understanding Data Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Using the Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Select Everything from Everything . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Select Some Things from Everything . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Where Is the Where Clause? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Select Everything from Some Things . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Select Some Things from Some Things . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 IS Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Compound Where Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Is Not Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Understanding Event Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Understanding Schema Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 SWbemObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 SWbemObjectPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Quiz Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 On Your Own . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Lab 7 Exploring Win32_NTDomain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 Lab 8 Using Schema Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4 Using Advanced WMI Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Using __Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Using ISA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Scripting API Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 SWbemServices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Using the associators of Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Using the references of Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Modifying the Where Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Using the ExecQuery Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Returning an SWbemObjectSet Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Iflags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Using the Get Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 SWbemLastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 SWbemObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 SWbemObjectPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 www.it-ebooks.info A05T622310.fm Page x Tuesday, September 27, 2005 7:55 AM x Table of Contents SWbemObjectSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 SWbemProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 SWbemPropertySet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 SWbemSink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Introducing New Objects in Windows XP and Windows Server 2003 . . . . . . . . . . . . 96 SWbemDateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 SWbemObjectEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 SWbemRefresher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 SWbemRefreshableItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 SWbemServicesEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Quiz Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 On Your Own . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Lab 9 Working with the AutoDiscovery Process . . . . . . . . . . . . . . . . . . . . . . . . 99 Lab 10 Using the Get Method for Inventory Types of Data . . . . . . . . . . . . . . 101 5 Using WMI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Using SWbemEventSource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 NextEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Security_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Working with SWbemServices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 ExecNotificationQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 ExecNotificationQueryAsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Understanding Event Consumers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Creating an Instance of the Consumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Creating an Event Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Creating an Event Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Binding the Filter to the Consumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 ActiveScriptEventConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Using SMTPEventConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Understanding the New Event Consumers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 LogFileEventConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 NTEventLogEventConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 CommandLineEventConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Working with Different Types of Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Class Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Instance Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 www.it-ebooks.info [...]... script work on Windows Server 2003, but not on Microsoft Windows XP with Service Pack 2 installed? How can I find out everything I can do with WMI on the network? Microsoft Windows Scripting with WMI: Self-Paced Learning Guide addresses these common questions and more Background Windows Server 2003 makes significant changes to WMI Dozens of new and exciting providers expose hundreds of new WMI classes... my Microsoft Windows Scripting Self-Paced Learning Guide Indeed, the self-paced learning guide and this WMI book complement one another, and together they form the basis of a complete scripting library Microsoft Windows Scripting with WMI: Self-Paced Learning Guide assumes much of the knowledge presented in the self-paced learning guide No information is duplicated Is This Book for Me? Microsoft Windows. .. Scriptomatic is a Microsoft scripting tool that assists you in writing WMI scripts and teaches you the fundamental concepts of WMI scripting Scriptomatic can be downloaded from the following location: http://www .microsoft. com/technet/scriptcenter/createit.mspx The Basics of WMI The basics of WMI are covered in Chapters 8, 9, and 10 of Microsoft Windows Scripting Self-Paced Learning Guide (http://www .microsoft. com/MSPress/books/... http://www .microsoft. com/mspress/support/search.asp If you have comments, questions, or ideas regarding this book or the companion CD, please send them to Microsoft Press using either of the following methods E-Mail mspinput @microsoft. com Postal Mail Microsoft Press Attn: Microsoft Windows Scripting with WMI: Self-Paced Learning Guide Project Editor One Microsoft Way Redmond, WA 98052 Please note that Microsoft. .. WMI from a scripting standpoint The six parts of the book are discussed in the following subsections Part I: Getting Started with WMI There are two chapters in Part I In Chapter 1, “Introducing WMI, ” I provide a comprehensive introduction to WMI and discuss in a general manner where WMI came from, how classes are formed, and the WMI architecture I close the chapter with a discussion of the WMI database,... “Configuring WMI, ” I discuss in detail how to tweak WMI We look at the registry settings related to WMI, and you get your first look at the WMI Control Properties console ■ Chapter 1: Introducing WMI ■ Chapter 2: Configuring WMI Part II: WMI Queries and Events Did you know WMI has its own query language? It is similar to structured query language (SQL) but is called WQL instead WQL, which stands for WMI Query... Windows Scripting with WMI: Self-Paced Learning Guide is aimed at several audiences, including the following: ■ Windows networking consultants Anyone who wants to standardize and automate the installation and configuration of Microsoft NET Framework networking components ■ Windows network administrators Anyone who wants to automate the day-to-day management of Windows Server 2003 networks ■ Windows. .. things you could do with the Active Directory directory service in Microsoft Windows 2000 Server have been removed The result is that any WMI book based on Windows 2000 is simply out of date Network administrators and consultants need to go beyond simply developing a script that queries a single WMI class by using the Microsoft Scriptomatic Although the Scriptomatic is useful for exploring WMI and can save... all vital questions, WMI can do much more The problem is that, until now, no book has been written in a clear, concise manner to assist IT professionals in gaining the vital skills required to leverage this flexible technology Editorial Objectives and Approach Microsoft Windows Scripting with WMI: Self-Paced Learning Guide can equip readers with the tools to harness the power of WMI Concepts are broken... write custom scripts to manage, monitor, and control Windows Server 2003 networks The approach I take to teaching readers how to use WMI scripting to automate servers that run the Windows operating system is similar to the approach I use in my highly successful book Microsoft Windows Scripting Self-Paced Learning Guide I take a topic, develop a WMI script that illustrates the essential learning point, . Directory, Excel, JScript, Microsoft Press, MSDN, Outlook, Visual Basic, Win32, Windows, Windows NT, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in. book. Martin DelRe at Microsoft Press has been awesome to work with and is an enthusiastic supporter of scripting in general and of Windows Management Instrumentation (WMI) in particular. Melissa. Glance Part I Getting Started with WMI/ 1 Introducing WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Configuring WMI. . . . . . . . . . . .

Ngày đăng: 05/05/2014, 15:16

Mục lục

    Contents at a Glance

    Editorial Objectives and Approach

    Is This Book for Me?

    Organization of the Book

    Part I: Getting Started with WMI

    Part II: WMI Queries and Events

    Part III: Connect Server and Additional Privileges

    Part V: Security and Troubleshooting

    About the Companion CD

    Part I: Getting Started with WMI

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan