● ● ● ● ● ● ● ● ● ● ● How to access your CD files The print edition of this book includes a CD. To access the CD files, go to http://aka.ms/VBSScriptSBS/files, and look for the Downloads tab. Note: Use a desktop web browser, as files may not be accessible from all ereader devices. Questions? Please contact: [email protected] Microsoft Press PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2007 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: 2006934395 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 1 0 9 8 7 6 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 infor- mation about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to [email protected]. Microsoft, Microsoft Press, Active Directory, ActiveX, Excel, MSDN, Visual Basic, Win32, Windows, Windows NT, Windows Server, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. 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 without 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 Editor: Maureen Williams Zimmerman Copy Editor: Sarah Wales-McGrath Technical Reviewer: David Holder Indexer: Jeanne Busemeyer Body Part No. X13-24158 Dedication This book is dedicated to my best friend, Teresa. Contents at a Glance Part I Covering the Basics 1 Starting from Scratch . 3 2 Looping Through the Script . 25 3 Adding Intelligence . 55 4 Working with Arrays . 81 5 More Arrays . 113 Part II Basic Windows Administration 6 Working with the File System . 139 7 Working with Folders . 165 8 Using WMI . 187 9 WMI Continued . 207 10 Querying WMI . 227 Part III Advanced Windows Administration 11 Introduction to Active Directory Service Interfaces . 251 12 Writing for ADSI. 269 13 Using ADO to Perform Searches . 293 14 Configuring Network Components. 315 15 Using Subroutines and Functions . 329 16 Logon Scripts . 349 17 Working with the Registry . 367 18 Working with Printers . 381 v vi Contents at a Glance Part IV Scripting Other Applications 19 Managing IIS 6.0 . 395 20 Working with Exchange 2003 . 407 21 Troubleshooting WMI Scripting . 419 Part V Appendices A VBScript Documentation . 443 B ADSI Documentation. 449 C WMI Documentation. 457 D Documentation Standards . 463 E Special Folder Constants. 467 Index . 469 Table of Contents Acknowledgments. .xvii Introduction . xix Part I Covering the Basics 1 Starting from Scratch . 3 Running Your First Script . 3 Header Information . 5 Reference Information. 8 Worker Information . 9 Output Information . 12 Enhancing Your Script . 13 Modifying an Existing Script. 14 Modifying the Header Information. 15 Modifying the Reference Information. 16 Modifying the Worker Information . 18 Modifying the Output Information . 19 Exploring a Script: Step-by-Step Exercises . 22 One Step Further: Customizing an Existing Script. 22 2 Looping Through the Script . 25 Adding Power to Scripts . 25 For Each…Next . 26 Header Information . 27 Reference Information. 30 Worker Information . 30 For…Next . 31 Header Information . 32 Reference Information. 33 Worker and Output Information . 34 Microsoft is interested in hearing your feedback about this publication so we can What do you think of this book? continually improve our books and learning resources for you. To participate in a brief We want to hear from you! online survey, please visit: www.microsoft.com/learning/booksurvey/ vii viii Table of Contents Do While…Loop . 37 Header Information. 38 Reference Information . 39 Worker and Output Information. 40 Do Until…Loop . 43 Worker and Output Information. 45 Do…Loop . 47 While…Wend. 47 Creating Additional Objects. 48 Using the For Each…Next Command Step-by-Step Exercises . 51 One Step Further: Modifying the Ping Script . 52 3 Adding Intelligence . 55 If…Then . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages82 Page
-
File Size-