100% found this document useful (2 votes)
14 views

Advanced VBScript for Microsoft Windows Administrators Don Jones instant download

The document is a promotional overview for the book 'Advanced VBScript for Microsoft Windows Administrators' by Don Jones and Jeffery Hicks, which covers advanced scripting techniques for Windows administrators. It includes various sections on scripting basics, packaging scripts, remote scripting, and enterprise-level scripting. Additionally, it provides links to download the book and other related resources.

Uploaded by

nissanpurger
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
14 views

Advanced VBScript for Microsoft Windows Administrators Don Jones instant download

The document is a promotional overview for the book 'Advanced VBScript for Microsoft Windows Administrators' by Don Jones and Jeffery Hicks, which covers advanced scripting techniques for Windows administrators. It includes various sections on scripting basics, packaging scripts, remote scripting, and enterprise-level scripting. Additionally, it provides links to download the book and other related resources.

Uploaded by

nissanpurger
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

Advanced VBScript for Microsoft Windows

Administrators Don Jones pdf download

https://ebookfinal.com/download/advanced-vbscript-for-microsoft-
windows-administrators-don-jones/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Windows PowerShell v1 0 TFM 2nd Edition Don Jones

https://ebookfinal.com/download/windows-powershell-v1-0-tfm-2nd-
edition-don-jones/

Microsoft Outlook 2007 Programming Jumpstart for Power


Users and Administrators Sue Mosher

https://ebookfinal.com/download/microsoft-outlook-2007-programming-
jumpstart-for-power-users-and-administrators-sue-mosher/

Microsoft WSH and VBScript Programming for the Absolute


Beginner 2nd Edition Jr. Jerry Lee Ford

https://ebookfinal.com/download/microsoft-wsh-and-vbscript-
programming-for-the-absolute-beginner-2nd-edition-jr-jerry-lee-ford/

Windows Forensic Analysis Toolkit Advanced Analysis


Techniques for Windows 8 4th Edition Harlan Carvey (Auth.)

https://ebookfinal.com/download/windows-forensic-analysis-toolkit-
advanced-analysis-techniques-for-windows-8-4th-edition-harlan-carvey-
auth/
Microsoft Windows Vista Visual Encyclopedia Kate Shoup

https://ebookfinal.com/download/microsoft-windows-vista-visual-
encyclopedia-kate-shoup/

Be the Master 4th Edition Don Jones

https://ebookfinal.com/download/be-the-master-4th-edition-don-jones/

Hacking Exposed Windows Microsoft Windows Security Secrets


and Solutions Third Edition Joel Scambray

https://ebookfinal.com/download/hacking-exposed-windows-microsoft-
windows-security-secrets-and-solutions-third-edition-joel-scambray/

Microsoft Windows Registry Guide 2nd Edition Jerry


Honeycutt

https://ebookfinal.com/download/microsoft-windows-registry-guide-2nd-
edition-jerry-honeycutt/

How Microsoft Windows Vista Works 1st Edition Michael


Miller

https://ebookfinal.com/download/how-microsoft-windows-vista-works-1st-
edition-michael-miller/
Advanced VBScript for Microsoft Windows
Administrators Don Jones Digital Instant Download
Author(s): Don Jones, Jeffery Hicks
ISBN(s): 9780735622449, 0735622442
Edition: Kindle
File Details: PDF, 8.15 MB
Year: 2006
Language: english
6-2244-2eBookFM.book Page 1 Thursday, December 15, 2005 5:22 PM
6-2244-2eBookFM.book Page ii Thursday, December 15, 2005 5:22 PM

PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2006 by Don Jones and Jeffery Hicks
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 2005937886

Printed and bound in the United States of America.

1 2 3 4 5 6 7 8 9 QWT 9 8 7 6 5

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, ActiveX, Excel, FrontPage, JScript, Microsoft Press, MSDN, Tahoma, Verdana,
Visio, Visual Basic, Win32, Windows, the Windows logo, Windows NT, and Windows Server 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 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 Editor: Melissa von Tschudi-Sutton
Production: OTSI

Body Part No. X11-89440


6-2244-2eBookFM.book Page iii Thursday, December 15, 2005 5:22 PM

Contents at a Glance
Part I The Basics of Advanced Windows Scripting
1 Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
2 Script Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Part II Packaging Your Scripts


3 Windows Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4 Windows Script Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5 HTML Applications: Scripts with a User Interface . . . . . . . . . . . . . . . . . 125

Part III The Basics of Advanced Windows Scripting


6 Remote Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7 Database Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8 Advanced ADSI and LDAP Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
9 Using ADO and ADSI Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10 Advanced WMI Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
11 WMI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
12 Better Scripting with WMI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
13 Advanced Scripting in Windows XP and Windows Server 2003. . . . . 353

Part IV Scripting for the Enterprise


14 Group Policy Management Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
15 Exchange 2003 Scripting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
16 Microsoft Operations Manager 2005 Scripting. . . . . . . . . . . . . . . . . . . 463
17 Virtual Server 2005 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

Part V Appendix
Advanced Script Editor Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

iii
6-2244-2eBookFM.book Page iv Thursday, December 15, 2005 5:22 PM

iv Table of Contents
6-2244-2eBookFM.book Page v Thursday, December 15, 2005 5:22 PM

Table of Contents
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv

Part I The Basics of Advanced Windows Scripting


1 Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Prerequisite Knowledge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Understanding Windows Script Host Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Using the FileSystemObject Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Understanding Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Understanding Active Directory Services Interface Fundamentals . . . . . . . . . 24
Understanding Windows Management Instrumentation Fundamentals . . . . 29
Advanced Scripting Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Securing Your Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Creating Your Own Script Components and Libraries . . . . . . . . . . . . . . . . . . . . 34
Running Scripts Remotely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Retrieving Information from Active Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Manipulating Information Stored in a Database. . . . . . . . . . . . . . . . . . . . . . . . . 35
Managing Your Windows Environment with WMI Events . . . . . . . . . . . . . . . . . 35
Using New WMI Classes with Windows XP and Windows Server 2003 . . . . . 35
Managing Group Policy Objects with Scripting. . . . . . . . . . . . . . . . . . . . . . . . . . 35
Managing Your Exchange 2003 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Incorporating Your Scripts into Microsoft Operations Manager . . . . . . . . . . . 36
Creating a Visual Interface for Your Script with Internet Explorer and . . . . . . 36
HTML Applications (HTAs)
What We Won’t Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Finding Information about JScript, Perl, Python, and KiXtart . . . . . . . . . . . . . . 37
The Right Tool for the Job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Scripting Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

2 Script Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Script Encoding and Decoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

v
6-2244-2eBookFM.book Page vi Thursday, December 15, 2005 5:22 PM

vi Table of Contents

Script Signing and the Windows Script Host TrustPolicy . . . . . . . . . . . . . . . . . . . . . . . . 43


Understanding Digital Certificates and Script Signing . . . . . . . . . . . . . . . . . . . 43
Understanding WSH TrustPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Configuring WSH TrustPolicy in Your Environment . . . . . . . . . . . . . . . . . . . . . . 47
Signing Scripts by Using a Digital Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Using Software Restriction Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Alternate Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using the RunAs Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using Scheduled Tasks Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Using ADSI Alternate Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Using WMI Alternate Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

Part II Packaging Your Scripts


3 Windows Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Defining Windows Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Understanding XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
The package Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
The comment Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
The job Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
The runtime Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
The description Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
The example Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
The named Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
The object Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
The script Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Creating Script Jobs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Including Other Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Adding Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Creating Examples and Help Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Using Named Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
The name Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
The helpstring Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
The type Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
The required Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Viewing a Windows Script File in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6-2244-2eBookFM.book Page vii Thursday, December 15, 2005 5:22 PM

Table of Contents vii

Converting an Existing Script to a WSF Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72


Creating and Using a Wrapper WSF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

4 Windows Script Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95


Understanding COM Objects, Methods, and Properties . . . . . . . . . . . . . . . . . . . . . . . 95
Understanding Windows Script Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Using the Script Component Wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Working with Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Working with Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Working with Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Creating a Windows Script Component with a Script Editor. . . . . . . . . . . . . . . . . . . . 112
Viewing a Windows Script Component in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

5 HTML Applications: Scripts with a User Interface . . . . . . . . . . . . . . . . . 125


Understanding HTML Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Understanding the Internet Explorer Document Object Model . . . . . . . . . . . . . . . . 129
Understanding the HTML Document Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . 130
Understanding HTML Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Putting the DOM to Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Preparing Your HTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Using a Script Rather than an HTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Getting the Script Ready for an HTA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Understanding HTA Requirements and Essentials. . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Using HTA Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Sizing an HTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Using <div> and <span> Tags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Using Inline Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Working with Forms and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Populating a List Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Creating Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Connecting a Button to a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Using Check Boxes and Radio Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Adding Graphics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Adding Subroutines and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Viewing HTAs in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6-2244-2eBookFM.book Page viii Thursday, December 15, 2005 5:22 PM

viii Table of Contents

Part III The Basics of Advanced Windows Scripting


6 Remote Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Understanding Remote Scripting and Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Working with Windows Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Understanding Remote Scripting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Understanding Remote Scripting Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Viewing Remote Scripting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

7 Database Scripting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179


Understanding ActiveX Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Understanding Connection Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
ODBC DSN Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Connection Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Understanding Recordset Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Forward-Only Recordsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Other Types of Recordsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Recordset Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Understanding Command Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Understanding the Differences Between Databases . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Excel Workbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Access Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
SQL Server Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Understanding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Queries that Return Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Queries that Make Changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Viewing ActiveX Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

8 Advanced ADSI and LDAP Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207


Using the ADSI Scriptomatic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Connecting to a Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
6-2244-2eBookFM.book Page ix Thursday, December 15, 2005 5:22 PM

Table of Contents ix

Creating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210


Retrieving Object Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Using Other ADSI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Using the ADSI Software Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Using the PrimalScript Professional ADSI Wizard . . . . . . . . . . . . . . . . . . . . . . . 225
Writing Active Directory Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Using Search Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Using Data Return Limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Scripting the WinNT Provider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Scripting Active Directory Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

9 Using ADO and ADSI Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245


Understanding the ADSI Provider for ADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Connecting to ADSI by Using ADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Treating Active Directory as a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Writing ADSI Queries to Retrieve Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Writing ADSI Queries to Make Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Viewing ADO and ADSI in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260

10 Advanced WMI Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261


Understanding Advanced WQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Selecting Specific Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Including a WHERE Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Using the LIKE Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Using Queries and associator Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Understanding Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Writing Association Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Using Reference Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Using Advanced WMI Security Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Using the AuthenticationLevel Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Using the ImpersonationLevel Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Using the Privileges Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Viewing Advanced WMI Scripting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

11 WMI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285


Understanding WMI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
6-2244-2eBookFM.book Page x Thursday, December 15, 2005 5:22 PM

x Table of Contents

Understanding Consumers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286


Understanding Notification Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Understanding Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Understanding Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Using Notification Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Using WBEMTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Executing a Notification Query Semisynchronously . . . . . . . . . . . . . . . . . . . . 291
Executing a Notification Query Asynchronously . . . . . . . . . . . . . . . . . . . . . . . 294
Using Event Sinks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Using WMI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Using WMI Event Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Using WMI Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Viewing WMI Events in Action. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

12 Better Scripting with WMI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319


Using Tools as a Scripting Shortcut. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Using Scriptomatic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Listing Classes and Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Generating Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Saving Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Using WMIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Connecting to Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Using Aliases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Connecting to Remote Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Passing Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Making Queries with list and get. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Formatting Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Scripting with WMIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Enumerating Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Using WBEMTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Connecting to a Namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Using WMI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Using CIM Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Using WMI Object Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Comparing WMI Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
6-2244-2eBookFM.book Page xi Thursday, December 15, 2005 5:22 PM

Table of Contents xi

13 Advanced Scripting in Windows XP and Windows Server 2003. . . . . 353


Using New and Discontinued WMI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Using the Win32_PingStatus Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Configuring the Windows Firewall. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Using Disk Quota Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Using the DNS Provider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Using Active Directory Replication and Trusts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Using Internet Information Services 6.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Managing Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Using Windows Update Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389

Part IV Scripting for the Enterprise


14 Group Policy Management Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Introducing Group Policy Management Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Group Policy Management Scripting Requirements. . . . . . . . . . . . . . . . . . . . . 394
Group Policy Management Console Object Model . . . . . . . . . . . . . . . . . . . . . 394
Scripting GPO Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Scripting GPO Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Scripting GPO Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Scripting GPO Restores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Scripting Resultant Set of Policy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Viewing GPO Scripting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

15 Exchange 2003 Scripting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425


Introducing Exchange Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Querying Active Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Understanding Exchange 2003 WMI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Scripting the Exchange Server State Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Scripting Exchange Storage Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Scripting Exchange Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Viewing Exchange Server Scripting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462

16 Microsoft Operations Manager 2005 Scripting. . . . . . . . . . . . . . . . . . . 463


Introducing MOM Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Adding Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6-2244-2eBookFM.book Page xii Thursday, December 15, 2005 5:22 PM

xii Table of Contents

Defining Script Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467


Using Run Time Scripting Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Understanding Script Tracing and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . 473
Using Scripts in MOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Using Response Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Using Timed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Using State Variable Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Using Discovery Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Customizing MOM Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Viewing MOM Scripting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482

17 Virtual Server 2005 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483


Introducing Virtual Server Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Understanding the Virtual Server Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Writing Provisioning Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Writing Management Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Obtaining Object References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Managing Multiple-Virtual-Machines Templates . . . . . . . . . . . . . . . . . . . . . . . 491
Performing Virtual Machine Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Performing Virtual Disk Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Performing Guest OS Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Performing Mouse and Keyboard Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Viewing Virtual Server Scripting in Action. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501

Part V Appendix
Advanced Script Editor Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
6-2244-2eBookFM.book Page xiii Thursday, December 15, 2005 5:22 PM

Acknowledgements
I’d like to thank Jeffery, who has easily been one of the best co-authors anyone could ask for.
Writing a book can be exceedingly stressful and time-consuming, and a good co-author can
really help alleviate a lot of that. Thanks also go out to everyone at SAPIEN Technologies:
Jonathan, Alex, and Ferdinand, who provided assistance with tools and technologies that
were ancillary to the book’s main purpose, making things much smoother. Finally, a big cheer
is due all the users at ScriptingAnswers.com, whose persistence and unwavering support of
the scripting community were a primary motivation for bringing this book to market.

Don Jones
Las Vegas, NV

Writing your first book can be a daunting and sometimes frightening task. Fortunately, I had
a great writing partner. Thanks, Don, for being such a terrific guide in the strange new world
of publishing. Thanks, too, to the people at Visory Group. I truly appreciate the flexibility you
give me to take on projects like this one. Finally, I want to say an extra big thank-you to Beth,
Lucas, and Ellie. Without the love, support, and understanding of my new family (“Daddy has
to work again tonight?”), I would never have made it this far. You’re the reason I work so hard.

Jeffery Hicks
Syracuse, NY

xiii
6-2244-2eBookFM.book Page xiv Thursday, December 15, 2005 5:22 PM
6-2244-2eBookFM.book Page xv Thursday, December 15, 2005 5:22 PM

Introduction
When writing my first scripting book, Managing Windows with VBScript and WMI (Addison-
Wesley, 2004), I set out to create what was at the time an industry first: a book designed not
for developers but specifically for Microsoft Windows administrators with very little VBScript
experience who wanted to learn just enough VBScript to be effective. Since that book was
published, Windows administrators have become more and more skilled with Windows
Script Host, VBScript, Windows Management Instrumentation, and other related technolo-
gies. Because administrators attending conferences and viewing my Web site (http://
www.ScriptingAnswers.com) are beginning to ask questions about more complex technologies
and techniques, the time has come for a book that covers advanced topics.

In this book, my able co-author, Jeffery Hicks, and I try to cover some of the more advanced
scripting techniques that we use every day. We certainly aren’t pretending that we touch on
every topic that might be considered “advanced”; after all, scripting is as varied and complex
as Microsoft Windows itself. Instead, we try to cover the most useful advanced technologies,
recognizing that our fellow administrators are typically as practical and pragmatic as we are.
We also try to cover these technologies in much the same way that we learned about them,
by presenting complete solutions and line-by-line walkthroughs, so that you can see the final
product as well as a detailed description of how and why it works.

Personally, I’m delighted that Windows is now such a mature, stable product that we have the
time and tools to explore automation through scripting. I’m also glad that more administra-
tors are tackling advanced topics, which tells me that Windows has truly become an enter-
prise operating system, with the level of complexity and scriptability often associated with
traditional enterprise-class operating systems such as UNIX.

Jeffery and I both appreciate that you’ve selected this book for your further scripting educa-
tion. We certainly hope you find it useful! That said, we want to offer a brief word of caution:
This is truly an advanced book. We don’t take the time to explain basic scripting concepts,
and we assume that you already have medium- to high-level scripting skills. We do cover a few
basics at the beginning of the book, but only to provide a quick refresher of techniques you
might not use every day.

With that caveat out of the way, I want to wish you the best of luck with your scripting efforts!

Don Jones

xv
6-2244-2eBookFM.book Page xvi Thursday, December 15, 2005 5:22 PM

xvi Introduction

Who Is This Book For?


This book is intended for Microsoft Windows administrators who want to take their scripting
to the next level. We’re assuming readers have intermediate to advanced scripting skills and
are looking for new techniques and ideas to expand their scripting toolbox. This book is also
for scripting administrators who want to expand their realm into products such as Microsoft
Exchange 2003 and Microsoft Virtual Server 2005. If you’ve never worked with VBScript
before, then this book definitely isn’t for you. We’re not spending much time on the basics,
and you’ll certainly need those basics to understand what we’re covering here. If you’d like a
more introductory-level book, consider Don Jones’ Managing Windows with VBScript and
WMI (Addison-Wesley, 2004) or a similar title.

Conventions in This Book


This book is relatively straightforward, and there are no tricky conventions that readers need
to be aware of. However, the following reader alerts are used throughout the book to point out
useful information:

Reader Alert Meaning


Tip Provides a helpful bit of inside information about specific tasks or functions
Note Alerts you to supplementary information
Caution Contains important information about possible data loss, breaches of security,
or other serious problems
On the CD Identifies tools or additional information available on the CD that accompanies
the book
Best Practice Identifies techniques or conventions that are recognized as industry standards;
while not following these practices won’t break anything, they can make things
easier and more efficient.

System Requirements
To use the Advanced VBScript for Microsoft Windows Administrators companion CD, you’ll need
a computer equipped with the following configuration:

■ Pentium II (or similar) with 266-megahertz (MHz) or higher processor.


■ CD-ROM or DVD-ROM drive.
■ Microsoft Mouse or compatible pointing device.
■ Microsoft Windows Server 2003, Microsoft Windows 2000, or Microsoft Windows XP.
We assume you’ve installed the latest service packs, although in most cases we don’t
cover information specific to a given service pack (and when we do, we mention it).
■ Windows Script Host (WSH) version 5.6 or later. WSH is a core component of Windows
2000 and later versions, so unless you’ve taken special steps to remove this software, it
should already be installed.
6-2244-2eBookFM.book Page xvii Thursday, December 15, 2005 5:22 PM

Introduction xvii

■ Some scripts—notably the ones dealing with Microsoft Exchange Server 2003, Microsoft
Virtual Server 2005, or Microsoft Operations Manager 2005—require additional
Microsoft products, as appropriate.
■ Microsoft Internet Explorer 5.5 or later.
■ Adobe Acrobat or Acrobat Reader.

About the Companion CD


To provide you with quick and easy access to the tools you need to get the most out of this
book, we’ve included the following on the companion CD:

■ The scripts presented in the book.


■ Links to any of the URLs we mention that are too long to type easily.
■ A number of additional tools (or links to them).

Do take a few moments to explore the CD and all it contains. If you’d like to pursue scripting
beyond the topics included in this book, we invite you to visit Don’s Web site at http://
www.ScriptingAnswers.com. You’ll find additional script samples, training, discussion forums for
questions and answers, and more resources, all designed for Windows administrative scripting.

Support for This Book


Every effort has been made to ensure the accuracy of this book and the contents of the com-
panion CD. Microsoft Press provides general support information for its books and compan-
ion CDs at the following Web site:

http://www.microsoft.com/learning/support/books

To search for book and CD corrections for this book by using the book’s ISBN, go to

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: Advanced VBScript for Microsoft Windows Administrators project editor
One Microsoft Way
Redmond, WA 98052

Please note that Microsoft software product support is not offered through the above addresses.
6-2244-2eBookFM.book Page xviii Thursday, December 15, 2005 5:22 PM

You are welcome to contact the authors at http://www.ScriptingAnswers.com to ask questions


or discuss problems that you might have regarding the scripts included on the CD that accom-
panies this book.
Part I
The Basics of Advanced Windows
Scripting
In this part:
Chapter 1: Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Script Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Discovering Diverse Content Through
Random Scribd Documents
latter, had acquired such an influence over King Edward that he had
presented her with the jewels of his wife, and frequently permitted
her to dispense at her pleasure the favors of the crown. The
Commons publicly demanded that she should be banished from the
kingdom.

Amidst this work of reform, the Parliament suddenly lost its firmest
support.

The Black Prince died on the 8th of June, 1376. For a long time he
had been ailing, and unable to assume in the government of his
country the position which by right belonged to him; but the nation
had always reckoned upon his wisdom and justice no less than on
his brilliant valor; a prosperous and happy reign had been hoped
for, and the grief was general and protracted. "The good fortune of
England seemed bound up in his person," says the chronicler
Walsingham; "it had flourished in his health, it languished in his
illness, and died at his death; in him expired all the hopes of the
English. For during his lifetime neither an invasion of the enemy nor
an encounter in battle had been feared." He was interred with
great pomp in Canterbury Cathedral, where he had formerly
erected a chapel in memory of his marriage. At the especial request
of Parliament, his eldest son Richard was thereupon declared heir
to the throne. Fears were entertained concerning the pretensions of
the Duke of Lancaster, who had resumed all his authority. Sir Peter
de la Mare, who had impeached the ministers in the name of
Parliament, was arrested. The Bishop of Winchester, William of
Wykeham, formerly at the head of the opposition, was divested of
his revenues. A Parliament favorable to John of Gaunt was
convoked; it proposed the recall of Alice Perrers, the rehabilitation
of Lord Latimer, and other measures so unpopular that the palace
of the duke was assailed by the citizens of London, and his friend
Lord Percy, a Marshal of England, was pursued by the mob, so that
the prince was obliged to throw himself into a small boat with
Percy, and take refuge at Kennington, in the castle inhabited by the
young Prince Richard and his mother. All the remonstrances of the
Bishop of London scarcely succeeded in calming the disturbance.
The arms of the Duke of Lancaster, at the gate of his palace, were
inverted by the people as the escutcheon of a traitor. When the
duke returned shortly afterwards to London, all the magistrates of
the city were dismissed and replaced by his creatures. On the
occasion of the fiftieth anniversary of the reign of Edward III., a
general amnesty was proclaimed; the Bishop of Winchester alone
was excluded from it.

It was the last public act of King Edward; this body so active and
robust, this spirit so bold, this will so firm, had nevertheless
undergone the effects of premature old age. The ministers were
ranging themselves beside the Duke of Lancaster; the opposition
was grouped around the young Prince Richard and the Princess of
Wales; the old king was dying alone, with Alice Perrers. It is even
said that she deserted him in his agony, after having taken the
royal ring from him. The king lay in this isolation; the servants
having dispersed in the manor of Shene, to plunder at their leisure.
A monk entered, crucifix in hand; he approached the unhappy
monarch, praying beside him, and supporting his expiring head
until the last sigh. Thus died, on the 21st of June, 1377, the great
Edward III., who had at one time appeared destined to unite upon
his head the two crowns of France and England. He died alone, in
the sixty-fifth year of his age, leaving to his grandson, a child,
instead of the whole of Aquitaine, which he had received from his
father, a few towns only upon that soil of France of which he
claimed possession. The blood of the two nations had flowed
during more than thirty years, and the struggle was as yet only at
its beginning.
Chapter XII.

Bolingbroke.
Richard II. (1377-1398).
Henry IV. (1398-1413).
The little King Richard was much fatigued on the 16th of July,
1377; it was found necessary to place him in a litter to bring him
back to the palace, after his coronation. All the former popularity of
his grandfather Edward III., all the affection which his father the
Black Prince had inspired, appeared to have accumulated upon his
head, by reason of the fear and aversion which were felt towards
John of Gaunt, duke of Lancaster. The prelates and barons
assembled on the morrow of the coronation, and selected a council
of regency of twelve members. The uncles of the king did not form
part of this body, and John of Gaunt retired to his castle of
Kenilworth; but several members of the council remained devoted
to him, and his influence soon began to be complained of.

The King of France, Charles V., had lost no time in taking


advantage of the weakness of the English government: his fleets
overran the Channel, fettering commerce and seizing the British
vessels; a descent was even made upon the Isle of Wight. The
Parliament was convoked, and the Earl of Buckingham, the uncle of
the king, was placed at the head of the naval forces; his expedition
against the French fleet miscarried, and his defeat increased the
discontent of the nation. The Parliament was composed chiefly of
the enemies of the Duke of Lancaster, and when a kind of
reconciliation had been effected between the latter and the House
of Commons, that assembly demanded that two citizens of London
should be entrusted to receive the money voted for the defence of
the country. John of Gaunt started for France with a large army
(1378).

The King of Navarre, still at war with Charles V., held a portion of
Normandy; he had surrendered Cherbourg to the English. The Duke
of Brittany, John de Montfort, being reduced to the last extremity
by the successes of Bertrand du Guesclin, had consigned Brest to
them; but these acquisitions were due to the freewill of the allies of
England, and not to its arms. John of Gaunt was defeated before
St. Malo; and, being pursued by Du Guesclin, was compelled to
return to England, while the Scots, at the instigation of France,
invaded the northern counties and took possession of Berwick
Castle. A Scottish pirate, named John Mercer, devastated the coast
as far as Scarborough. A London merchant, named John Philpot, on
the other hand, armed a small fleet, and hastening to the
encounter of Mercer, recaptured from him all the vessels which the
latter had seized; captured, besides, fifteen Spanish ships, and
returned triumphantly into the Thames, amid the plaudits of his
fellow-citizens, and to the indignation of the council, which
reprimanded the alderman for the boldness of his undertaking.

The Parliament had assembled at Gloucester, disaffected and


exacting. The Commons asked to examine the accounts, which was
granted to them as a favor. John de Montfort had recently taken
refuge in England, banished from his dominions by King Charles V.,
who committed the imprudent act of officially annexing the duchy
of Brittany to France. This declaration immediately rallied all the
different factions against him. John de Montfort was recalled; the
States-general of Brittany wrote to the King of France, asking him
to authorize them to retain their independent ruler. At the same
time an English army, under the command of the Earl of
Buckingham, landed at Calais and ravaged the provinces of Artois,
Picardy, and Champagne without ever encountering the necessity of
a serious combat. The English were arriving in Brittany when King
Charles V. died (1378), and the Bretons, reassured by the weakness
of the young King Charles VI., began to look coldly upon their
English allies. De Montfort negotiated with the French council of
regency, and Buckingham was only indebted for his safety to the
valor of his troops and to the provisions which he had brought. He
retired in the spring of 1379. Great events were in preparation in
England.

For some years a double movement, religious and social, had


begun secretly to agitate the English people. A priest, John
Wycliffe, born towards 1324, in Yorkshire, had attracted attention at
the university of Oxford by his rare faculties, and had commenced,
in the year 1356, to denounce the abuses of the papal authority;
he had then attacked the mendicant monks, accusing the Church in
general of greed and corruption. Summoned to appear before the
Bishop of London, in the last year of the reign of Edward III., to
answer for his opinions, he had been supported by the Duke of
Lancaster and his friend Lord Percy; both had even insulted the
bishop, which had brought about an insurrection in the city.
Wycliffe had retracted some of his ideas, he had explained others;
and, thanks to his powerful protectors, he had obtained the living
of Lutterworth, in Leicestershire, where he spent the remainder of
his life, surrounded by priests, whom he brought up in truly
apostolic poverty, and who subsequently spread his opinions among
the people. Wycliffe is the first of the Reformers, or rather, their
precursor. His doctrines acted more powerfully abroad than in his
own country; it is to his books that were due the first germs of the
Reformation in Bohemia; for England, his greatest work was the
translation of the Bible into the vernacular. The most important of
his ideas was the appeal to the private judgment of the faithful
upon the very text of the Holy Scriptures. Wycliffe had shaken the
traditions of submission to the clergy; he had at the same time
preached a dangerous doctrine. "All possessions," he said, "come of
grace, and may be forfeited by sin." The poor serfs, who possessed
nothing, might be anxious to profit in their turn by the grace which
insured estates. Wycliffe died peacefully at Lutterworth in 1384.
Already, for two years past, his illustrious friend, Geoffrey Chaucer,
the first creator of English poetry, had been compelled to quit
England, compromised by his attachment to the new ideas; he had
retired into Hainault, where he lived in peace, protected by the
friendship of the Duke of Lancaster. The first works of Chaucer, The
Court of Love, the poem of Troilus and Cresseide, The
Temple of Fame, had been published several years before, and
had assured to him a reputation which had largely contributed to
his fortune. The English language at this time, still largely
intermixed with French, and difficult to understand at the present
time, assumed, under the pen of Chaucer, a native grace to which
sometimes succeeds an energy which prepared the way for Spenser
and Shakespeare. Chaucer again established himself in England
when John of Gaunt returned from his expedition to Castile; he
lived to an advanced age, and composed in his retreat of
Dumington his Canterbury Tales, written in the style of the
Decameron of Boccaccio, and the only one of his books which is
still read at the present day. He died in 1400, the year following the
accession of Henry Bolingbroke, the son of his protector. Like
Wycliffe, he had seen the commencement of the popular agitations.
The poll-tax voted by the Parliament in 1379 was their first
opportunity.

A general movement towards the enfranchisement of the lower


classes manifested itself everywhere in Europe. The insurrection of
the Jacquerie in France; the resistance of the Flemish citizens and
artisans, first, to the conduct of Jacques van Arteveldt and
afterwards to that of Philip, his son, had testified to the awakening
of the serfs, the peasants, and the artisans, so long reduced to the
condition of beasts of burden. The kings had been in need of
money, and the taxes weighing upon all their subjects, it had been
necessary to conciliate them. The soldiery had acquired a new
importance; the English archers, in particular, nearly all peasants by
origin, had played an important part in the wars. When the tax-
collectors began in 1380 to demand payment of the poll-tax, of a
people already impoverished by a long series of exactions, they met
with a resistance which increased with the oppression. The tax, at
first collected with leniency, was let out to some courtiers; they
borrowed in advance of the Lombards and Flemings; repayment
became necessary, and the revenue was exacted with great
severity. The peasants became exasperated; they began to
assemble and confer together; the insurrection broke out in Essex.
The "Commons of England," as the insurgents styled themselves,
broke into several dwelling-houses in the neighborhood; they
obeyed a seditious priest who assumed the name of Jack Straw.
The contagion rapidly spread into the counties of Kent, Suffolk, and
Norfolk. The tax was payable only in the case of persons above
fourteen years of age. A Kentish collector maintained that the
daughter of a tiler had attained the specified age; her mother
maintained the contrary; the collector insulted the young girl, and
was brained with a hammer by the father. A knight had reclaimed a
serf who thought he was entitled to enfranchisement, and had
imprisoned him in Rochester Castle; the peasants attacked the
castle and compelled the garrison to surrender the prisoner. The
Kentish insurgents marched under the command of a chief named
Wat Tyler (Wat the tiler). On the Monday of Trinity week, in 1381,
they entered Canterbury, threatening death to the archbishop, who
was absent. The monks of the chapter-house were compelled to
swear fidelity to King Richard and the commons of England. Three
wealthy burgesses were beheaded, and the crowd proceeded
towards London. It is related that one hundred thousand men
followed close upon the steps of Wat Tyler, when he arrived on the
11th of June at Blackheath.

The Princess of Wales, the mother of the young king, was returning
from a pilgrimage. The crowd of insurgents surrounded her retinue.
She was popular by reason of her husband's memory and her
ransom cost her only some kisses bestowed on the more audacious
of the leaders, who had not forgotten that she had formerly been
called "the fair maid of Kent;" she passed by without further
difficulty. The malcontents thronged round an itinerant preacher
whom they had brought with them, and who displayed to them this
text, now famous:—

"When Adam delved and Eve span,


Where was then the gentleman?"

The doctrine of equality was received with enthusiasm by these


poor people, hitherto trodden under foot. The outskirts of London
were laid waste when the king proceeded down the Thames, on
the 12th of June, to receive the petition of the insurgents. Ten
thousand men awaited his arrival at Rotherhithe; but at the sight of
the royal barge they uttered "such cries," says Froissart, "that one
would have thought that all the demons of hell were in their
midst." The noblemen who accompanied Richard became alarmed,
and dragged him with them as far as the Tower. "The Commons of
England," in a state of fury, advanced along the right bank of the
river as far as Lambeth, burnt down the prisons, and plundered the
palace of the Archbishop. On the other side of the Thames the
insurgents marched along the course of the river, and at length
obtaining a passage over London Bridge, they joined their brothers
of Kent. The whole city was in their power; the population of
London had joined them, and the rich citizens, to please them, had
thrown open their cellars to them. Hitherto, the multitude had
behaved with a certain amount of order, but intoxication being once
added to the joy of triumph, they could no longer be restrained;
the palace of the Duke of Lancaster was invaded and burnt down;
plunder was strictly forbidden; the gold was reduced to powder,
and the precious stones were broken. A peasant had taken a bowl
of money; he was thrown into the river with his booty. The prisons
being opened and destroyed brought fresh reinforcements to the
insurgents. The Temple was burnt, with all the valuable books
which had been collected by the knights. The priory of St. John of
Jerusalem, recently constructed by Sir Thomas Hales, a prior of the
order and Chancellor of the Kingdom, was also delivered up to the
flames. A thirst for blood began to take possession of the populace.
Every passer-by was challenged. "For whom are you?" was asked.
If the answer was not "For King Richard and the true commons,"
the person answering was immediately slaughtered. All the
Flemings fell by the knife or the hatchet; the popular hatred sought
them out even in the churches. Wine and blood flowed in the
streets; the counsellors of the king resolved to try concessions.

On the morning of the 14th of June a proclamation was spread


throughout London, recommending the crowd which surrounded
the Tower and demanded the heads of the chancellor and treasurer,
to retreat towards Mile End. The king promised there to come to
them and to grant their requests. A portion of the mob obeyed;
when Richard arrived with a weak retinue at the meeting-place (his
brothers, the Earl of Kent and Lord John Holland, had quitted him
on the road), he saw himself surrounded by sixty thousand
peasants. Their tone was respectful, and their requests, which then
appeared monstrous, do not create the same impression at the
present day. They demanded the definitive abolition of servitude;
the power to sell and purchase in all markets; and a general
amnesty for the past. To this they added a strange claim to fix the
amount of rental on lands. The king promised all that they wished,
and immediately caused to be made a large number of copies of
the charter which he had thus granted. These were distributed
among the insurgents; the men of Essex and Hertford retired in a
body; but the malcontents of Kent had remained in the capital, and
had not appeared at the meeting-place in Mile End. Scarcely had
the king retired when these dangerous foes attacked the Tower,
beheading the councillors who had taken refuge therein, the
Archbishop of Canterbury, the treasurer, Sir Thomas Hale, and
several others. The Princess of Wales, while yet in bed, saw a
furious mob spring into her chamber. No injury was done to her,
and her attendants were enabled to throw her, fainting with fright,
into a little boat; she was conveyed to a house in the city belonging
to the king, who there came and joined her when he had learnt the
sad news of the massacre at the Tower.
In the morning, Richard issued forth with a small escort, and
advanced fearlessly towards Smithfield. The multitude thronged the
streets and squares. The king drew up at St. Bartholomew's Priory.
"I will go no further," he said, "without having pacified the
insurgents." Wat Tyler had perceived him, and urging his horse
towards him, "There is the king: I go to speak to him," he cried to
his supporters; "do not move a hand or foot unless I give you the
signal." The horse of the popular chief touched heads with that of
the king. "Sir king," said Wat Tyler, "do you see those men
yonder?" "Yes," replied the young prince without stirring. "They are
at my disposal, and ready to do as I bid them." And he toyed with
his dagger, holding the bridle of the royal courser; then, perceiving
behind Richard an esquire who had displeased him, "Ah, you here?"
he said, "give me your sword." The esquire refused; Wat Tyler
made a motion to take possession of it; the followers of the king
were roused. The Lord Mayor of London, William Walworth, urged
forward his horse, and advancing towards the rebel, struck him a
blow with a dagger; the horse reared. Tyler endeavored to return
to his followers; an esquire of the king thrust his sword through his
body; he fell, beating the air with his hands. The mob became
agitated. "Our captain is slain," was the cry, and the bowstrings
began to vibrate. Richard advanced alone towards the crowd.
"What do you, my friends?" he exclaimed. "Tyler was a traitor; it is
I who am your captain and your guide." And he drew after him this
irresolute mob, deprived of their chief, and who marched without
knowing whither they were bound. They arrived in the fields near
Islington. The friends of the king had rallied round him. One of the
chiefs of his free bands, Sir Robert Knowles, brought a body of
men-at-arms. The insurgents took alarm, threw down their bows,
and cried "Mercy!" The king would not suffer them to be
slaughtered in a mass, to the great exasperation of Sir Robert
Knowles. "He said that he would be even with them on another
occasion," says Froissart; "in which he did not fail."

The insurrections subsided everywhere. The Bishop of Norwich had


armed his household and his friends, and hastening to throw
himself upon the peasants, he had easily defeated these confused
masses, little accustomed to arms. He had himself drawn up their
indictment and pronounced their sentence; then resuming his
clerical costume, he had exhorted them, received their confession,
absolved them, and finally accompanied them to the gallows. The
king was at the head of a small army, and had marched against the
remainder of the insurgents of Essex. It was no longer a question
of charters; the courts of commission were everywhere assembling
to try the guilty.

Death of Wat Tyler.


The two priests, Jack Straw and John Ball, were hanged. Lester and
Wistbroom, who had assumed the title of "Kings of the Commons"
in the counties of Norfolk and Suffolk, suffered the same fate.
About fifteen hundred rioters were executed. It was found
necessary to fix them to the gibbet with iron chains; their friends
came by night to carry off their bodies.

The Parliament had assembled, publicly approving of the abolition


of the concessions granted to the villeins during the struggle. "We
would never have consented to them," said the barons, "even had
we all been compelled to perish on the same day." For the
moment, there was some talk of abolishing servitude; but the
opposition was so strenuous, the proprietors of fiefs declared so
loudly that their serfs belonged to them by right, and that they
could not be deprived of them without their consent, that the idea
was immediately abandoned, and the high treason law was voted,
condemning "riots, disturbances, and other analogous things," in
terms as dangerous as they were vague. The king demanded
money, the commons claimed a complete amnesty; neither would
begin to make concessions. The Parliament at length yielded; the
tax upon wool and leather was prolonged for five years, and the
king proclaimed the amnesty; he was about to wed Anne of
Bohemia, soon known throughout the whole of her kingdom as "the
good queen." The Bishop of Norwich was fighting in Flanders, in
support of the citizens of Ghent hard pressed by their count,
recently a victor at the battle of Rosebecque, where Philip van
Arteveldt had been killed; and the uncles of the king contended
with each other for the authority in England. The Earl of Cambridge
had been made Duke of York, and the Earl of Buckingham Duke of
Gloucester. Henry Bolingbroke, son of the Duke of Lancaster, had
become Earl of Derby; at the same time, the king had made Earl of
Suffolk and Duke of Ireland, his favorites Michael de la Pole and
Robert de Vere, obscure persons, whom the Princess of Wales had
placed beside her son, by reason of her jealousy towards his
uncles; and who contributed, by their influence, to the struggles
and disputes of the government. The princess had recently died,
having succumbed beneath the weight of the anxieties caused by
one of her sons, Lord John Holland; he had recently assassinated
one of the servants of the king, and was unable to quit the church
in which he had taken refuge. Plot succeeded plot—denunciation to
denunciation. At length, the Duke of Lancaster started out for
Spain, in order to sustain the pretensions of his wife to the throne
of Castile; and he contrived, after two campaigns, to marry his
eldest daughter to the heir of Henry of Transtamare, thus assuring
the crown to her children. The Scots had crossed the frontier, and
King Richard entered Scotland. France was preparing a great
armament.

Amidst these external preoccupations, the Duke of Gloucester had


seized the reins of government; and, when the young king
threatened to dissolve a Parliament devoted to his uncle, the
Commons brought forward the Act which had deposed Edward II. A
council of barons for a while governed the kingdom, under the
presidency of Gloucester. Blood flowed everywhere; the duke
avenged himself upon the favorites of the king, who were as odious
to him as to the English people. He had impeached them before
the Parliament: the innocent were involved in the ruin of the guilty.
Gloucester did not even spare Sir Simon Burley, formerly the tutor
of the king, the friend of Edward III. and the Black Prince, and who
had conducted the negotiations for the marriage of Richard. The
queen in vain threw herself at his feet asking for mercy; in vain did
Henry Bolingbroke, who had seconded his uncle in all his
undertakings, claim as a right the pardon of the condemned man:
Burley was executed, and Bolingbroke became definitively at
variance with Gloucester.

The disorder which prevailed in England did not prevent constant


hostilities upon the frontiers of Scotland; it was on August 15th,
1388, that there took place at Otterbourn, the famous battle
celebrated in the ballads under the name of Chevy Chase, between
the Earl of Douglas and Lord Henry Percy, the Hotspur of
Shakespeare. Douglas was slain, but the English ended by being
repulsed from the battle-field. Hotspur and his brother were
prisoners. The king was beginning to weary of the yoke which he
had so long borne. He was subject to gleams of resolution and
courage, which soon disappeared in a long spell of indolence, and
which took by surprise those who calculated upon his habitual
apathy. A council was being held in the month of May, 1389; the
king suddenly addressed the Duke of Gloucester. "How old do you
suppose I am, uncle?" he asked. "Your highness is in your twenty-
second year," replied the duke, much surprised. "Then," replied the
king, "I am at an age when I should govern my own affairs.
Nobody in my kingdom has been so long held under tutelage. I
thank you for your services, my lord, but I no longer require them."
And he immediately caused the great seal and the keys of the
treasury to be given up to himself, compelling the Duke of
Gloucester to leave the council, and announcing publicly to the
nation that he had henceforth assumed the direction of the
government. But his fleeting energy had already abandoned him.
The Duke of York and Henry Bolingbroke were his masters, instead
of the Duke of Gloucester.

John of Gaunt had returned from Castile; he had become reconciled


with his brothers. Concord appeared re-established in the royal
family; a truce had been concluded with France and Scotland. The
King of Scotland, Robert II., had died on the 19th of April, 1390,
and his eldest son had assumed the title of Robert III. Queen Anne
had also died, in 1394, and King Richard, who had no children,
married two years later, much against the wishes of his subjects,
the Princess Isabel, daughter of Charles VI., king of France. She
was but seven years old; but the king conceived the liveliest
affection for her, and conducted her everywhere with him upon his
travels. An expedition in Ireland against the insurgent chiefs had
been very successful; but the Duke of Gloucester protested with all
his might against the alliance with France. "Our Edwards," he said,
"caused Paris to tremble even in its entrails; but, under Richard, we
court the French, who make us tremble within London." The duke
had his reasons for trembling: the king had not forgotten the
execution of his favorites, nor the men who had signed their
indictment. The Earl of Warwick, one of the accomplices of
Gloucester, was already arrested; the Earl of Arundel soon followed.
The Duke of Gloucester had retired to Pleshy Castle, in Essex; his
nephew repaired there in gay company: all the family came forward
to meet the king; but, while the duchess was conversing with him,
Gloucester was arrested by the marshal of England, dragged as far
as the river, thrown into a boat, and from thence a vessel bore him
towards Calais. A rumor was thereupon spread that he had been
assassinated; the king published a proclamation declaring that the
arrests had been made with the approval of his uncles of Lancaster
and York, as well as of his cousin, the Earl of Derby. He had even
obtained, by a ruse, their signatures to the impeachment. Lord
Arundel was condemned by the Parliament, and immediately
executed; his brother, the Archbishop of Canterbury, was not even
admitted to plead his cause, for the king dreaded his eloquence; he
was banished for life, and the Earl of Warwick, at first condemned
to death, was imprisoned in the Isle of Man. The House of Lords
then called the Duke of Gloucester for judgment; but the marshal
replied that he could not bring the Lord Duke, who had for several
days been dead at Calais. He was condemned, however, and all his
goods were confiscated; it was said that he had been suffocated
between two mattresses. The judges were not without uneasiness
concerning the application which they had just made of the high
treason law: nearly all had been, at different periods, compromised
in plots or insurrections. They obtained of the king an amnesty for
the past; and, as a reward for present services, Richard made his
cousin the Earl of Derby, Duke of Hereford; the Earl of Nottingham
became Duke of Norfolk, and John Holland, the murderer, was
made Duke of Exeter. The Parliament completed its work of
complaisance by granting to the king, for life, a subsidy upon
woollens, and by forming a commission, entrusted to watch affairs.
King Richard was no longer in a hurry to appeal to his people, or to
convoke the Parliament.

The conduct of the king towards his uncle the Duke of Gloucester
and his friends, the vengeance which had overtaken, after so many
years, the enemies of the favorites, revealed the character of the
sovereign in a light which caused uneasiness in the country.
Indolent and prodigal, habitually engrossed in the pleasures of
luxury and magnificence, Richard was not only capable of
momentary energy, but he maintained in the bottom of his heart
projects which he shaped to his purposes with patient
perseverance. Once delivered of the Parliament and of the Duke of
Gloucester, the Duke of Lancaster aged and in retirement in his
castle, Richard gave himself up to all his whims, certain, as he
thought, of encountering no serious opposition. "At that time," says
Froissart, "no one was great enough in England to dare to speak
against the will of the king. He had a council obedient to his
wishes, who begged him to do as he pleased; and he had in his
pay ten thousand archers, who guarded him day and night." The
extravagances of the court were insensate, and the people began
to complain, looking back regretfully upon the government of the
king's uncles, who had shown some consideration, they said, for
the nation, and consulted it in its own affairs.

Two great noblemen alone remained of those who had, in 1386,


seconded the efforts of the Duke of Gloucester against the favorites
of the king; and, notwithstanding the favor shown to them by
Richard, they did not feel secure in their positions. The Duke of
Norfolk, galloping upon the road to Windsor, in the month of
December, 1397, encountered the Duke of Hereford. "We are
ruined," said he to his friend. "Wherefore?" asked Bolingbroke. "For
that affair at Radcot Bridge." [Footnote 5]

[Footnote 5: The Duke of Ireland (Robert de Vere) had


been defeated by Gloucester and his companions, at
Radcot Bridge.]

"What! after so many pardons and declarations by the Parliament?"


rejoined Bolingbroke. "He will annul all that, and we shall pass
through the ordeal like the others; the world in which we live is
strangely perfidious." The Duke of Norfolk soon had reason to be
convinced of this. Either through thoughtlessness or through
treachery, the conversation was reported to the king; he convoked
the Parliament, and his first care in the month of January, 1398,
was to summon Henry Bolingbroke to render an account of the
words of the Duke of Norfolk. The latter was not present, but upon
the summons of the Parliament, he came to throw down his glove
at the feet of the Duke of Hereford, declaring him a traitor and a
perjurer: the combat was authorized between the two noblemen. "I
shall then at length have peace," muttered the king, while
proceeding to Coventry, on the 16th of September, to be present at
the tournament. But having once confronted the two antagonists,
he became fearful of a victory for one of them, and, forbidding the
ordeal, he submitted the question to a Parliamentary commission
chosen by himself. The Duke of Hereford was condemned to an
exile of ten years. The Duke of Norfolk was banished forever. He
thereupon started for the Holy Land, and died of grief at Venice.
But Henry Bolingbroke did not go far away; he remained in France,
watching the movements of his cousin Richard, who lavished the
riches of England with so thoughtless a hand, that his treasury was
constantly empty. His favorites would then help him to replenish it
by exactions of every kind. The Duke of Lancaster had died three
months after the departure of his son; his immense property was
confiscated, notwithstanding the protests of Bolingbroke. A decree
outlawed seventeen counties of England, as having been favorable
to the enemies of the king; they were compelled to buy back their
rights with enormous fines. The disaffection increased, but the king
took no heed whatever of it. He embarked towards the end of May,
1390, for Ireland, where his cousin and heir-apparent, the Earl of
March, had recently been assassinated. He had just taken the field
against the rebels, when Henry Bolingbroke landed, on the 4th of
July, at Ravenspur, in Yorkshire, having escaped from France under
the pretext of paying a visit to the Duke of Brittany.

Bolingbroke had brought with him a feeble following, the exiled


Archbishop of Canterbury, and his nephew, the Earl of Arundel,
fifteen knights and men-at-arms, and a few servants; but scarcely
had he touched the English soil, when the Earls of Northumberland
and Westmoreland joined him, bringing with them considerable
forces. Henry did not disclose his ulterior projects to anybody; he
came, he said, to claim his right, the inheritance of his father,
which the king had wrongly confiscated, and moreover the public
feeling was so favorable to him, the nation was so weary of seeing
itself ill-governed, that the malcontents rose in all parts to place
themselves under his standard. He was, it is said, at the head of an
army of sixty thousand men when he advanced towards London.
The Duke of York, regent of the kingdom in the absence of Richard,
did not rely upon the burgesses of the City; he had quitted the
capital, and displayed the royal standard at St. Alban's. Terror
began to seize the creatures of the king: instead of marching
against the rebels, they cowardly shut themselves up in fortified
castles. The Duke of York had taken the western road, pending the
return of King Richard; but Bolingbroke had used diligence, and he
arrived at the Severn on the same day as the regent. The latter
placed little confidence in his troops; he was aware of the general
discontent, and he retained in the bottom of his heart a bitter
resentment for the murder of his brother Gloucester. He granted an
interview to his nephew Bolingbroke: the firm, bold and cunning
mind of Henry triumphed easily over the feeble will of the Duke of
York; the two armies were amalgamated, and the regent helped
the usurper to take Bristol Castle. There the members of the
commission which had formerly condemned Bolingbroke had taken
refuge; they were executed without any form of trial, and the Duke
of Lancaster marched upon Chester, leaving his uncle at Bristol.

For three weeks Richard had remained in ignorance of what was


taking place in his kingdom. When he at length learnt the news of
the landing of Henry and his formidable progresses, he exclaimed
bitterly, "Ah! my good uncle of Lancaster, the Lord have mercy on
your soul! If I had believed you, although this man might be your
son, he would never have harmed me. Three times I have forgiven
him; this is his fourth offence." The Earl of Salisbury immediately
set sail to assemble together some troops in England; he had
raised pretty considerable forces in Wales; but the king delayed, the
soldiers murmured and dispersed by degrees; a large number went
and joined the rebels. The king at length disembarked with his
cousin, the Duke of Albemarle, and his two brothers, the Dukes of
Exeter and Surrey. The little army which he had taken to Ireland
followed him: but at the second halting-place, when the king,
having risen very early, looked through the window towards the
camp, where on the previous evening, six thousand soldiers had
slept, he no longer saw but a handful of archers and men-at-arms:
all had deserted during the night. The king was advised to take
refuge at Bordeaux. "That would be to abdicate," said his brother,
the Duke of Exeter. It was resolved that they should join the Earl of
Salisbury, and the king, disguised as a priest, took the road to
Conway, with his brothers and a few servants, while the Duke of
Albemarle, following the example of his father, the Duke of York,
fled by night to join the army of he usurper.

The Earl of Salisbury had not a hundred men with him when the
king arrived at Conway. In this deplorable situation, the brothers of
King Richard proposed to go to Henry at Chester, in order to
ascertain his pretensions. The two dukes did not return; their
cousin Bolingbroke received them kindly, but he positively refused
to release them: all his efforts were directed towards seizing the
king in person. The Earl of Northumberland was entrusted with this
mission. By false promises he enticed the king out of Conway,
proposing an interview with Bolingbroke at Flint. Richard was
almost alone, abandoned; he followed the earl with the friends who
remained to him. They galloped along slowly, when suddenly the
king cried, "I am betrayed! Lord in Heaven, help me! Do you not
see banners and pennants flying in the valley?" Northumberland
advanced at the same time. "My lord," the unhappy monarch said
to him abruptly, "if I thought you capable of betraying me, I could
yet retreat." "No," replied the Earl, who had laid hold of his bridle;
"I have promised to conduct you to the Duke of Lancaster." The
soldiers of Northumberland began to appear; the king yielded to
necessity. "Our Saviour was sold and delivered into the hands of
His enemies," he murmured.
They arrived at Flint. Henry Bolingbroke, in all his armor, came
forward to meet his royal cousin, and bent his knee on
approaching. "Good cousin of Lancaster," said Richard courteously,
"you are welcome." "My lord," replied Henry, "I have come before
my time, but I will tell you the reason: your people complain that
you have governed them harshly for twenty-two years; if it please
God, I will help you rule them better." "Since it pleases you, it
pleases me also," meekly replied the fallen monarch; and, seated
upon a wretched courser, like a prisoner, King Richard took the road
to Chester, side by side with Henry Bolingbroke. Froissart relates
that his very dog abandoned him to lick the hand of the usurper.

At Lichfield Richard attempted to escape; but he was seized as he


had just issued forth through a window, and thereafter was
narrowly guarded. The people of London received him with yells
and insults. The usurper repaired to St. Paul's, prayed upon the
tomb of his father, and then took possession of the palace. The
king had been led to the Tower.

The Parliament was convoked, and ready to depose Richard II., as


it had formerly deposed his great-grand-father; but Henry
Bolingbroke, with a bitter foresight of the mutability of human
things, wished to secure the personal consent and the voluntary
abdication of the king. He held him narrowly confined within the
Tower. "Why do you cause me to be thus guarded?" Richard angrily
exclaimed one day; "Am I your king or your prisoner?" "You are my
king," replied the duke; "but the council of your kingdom have seen
fit to place a guard beside your person." On the eve of the opening
of Parliament, a deputation of prelates and barons paid a visit to
the unhappy king in the Tower, and asked him to abdicate. Richard
felt himself powerless in the hands of his enemies; he yielded,
"willingly and joyfully," say the acts of Parliament; and, releasing
his subjects from their oath, he consigned his royal ring to his
cousin of Lancaster, saying that he would choose him for his
successor, if he had the right to designate him. These details are
open to doubt, but the Parliament held them good, and on the 30th
of September, before the empty throne, in Westminster Hall, the
abdication of Richard was read aloud, all the members giving their
consent to it. The people uttered cries of joy. The coronation oath
was then brought, and, at each article, proclaimed aloud, the
impeachment of King Richard was drawn up. He was accused of
the murder of his uncle Gloucester; of having revoked the
amnesties, and of having squandered the public money. Nobody
raised his voice for the dethroned monarch until the Bishop of
Carlisle, Thomas Merks, rose and publicly denied the right of the
Parliament to depose the king and to change the order of
succession, at the same time defending Richard against his
accusers. Scarcely had he finished his discourse, when he was
arrested. While he was being conducted to St. Alban's, the
Parliament pronounced the deposition of Richard, and the Lord
Chief Justice was instructed to announce his fall to him. "I care not
to court the regal authority," said the deposed king; "I only hope
that my good cousin will be a good master to me."

His good cousin was not yet legally king; the descendants of Lionel,
the third son of Edward III., were the legitimate heirs to the
throne; no one, however, thought of them. The Duke of Lancaster
had remained in his seat; his surrounders waited in profound
silence. He rose, and, solemnly making the sign of the cross, said
in a very loud voice, "In the name of the Father, of the Son, and of
the Holy Ghost, I, Henry of Lancaster, lay claim to this kingdom of
England and to the crown, as a descendant of the good King Henry
III., and by the right which God has given me, by granting to me
the favor, through the support of my friends, to come to the
assistance of this country, which was about to perish under bad
laws and for want of government."

This mixture of hereditary pretensions with popular rights was


skilful. The Parliament responded to the appeal of Henry
Bolingbroke; acclamations broke out in all parts; the duke showed
the ring which Richard had consigned to him; the Archbishop of
Canterbury took him by the hand and led him to the foot of the
throne. Henry knelt there for a moment; he then ascended the
steps and seated himself resolutely. The plaudits recommenced
during the discourse of the archbishop. "I thank you, my lord," said
the new monarch; "and I wish everybody to know that, by right of
conquest, I will disinherit nobody of his rights, but wish that all
may be governed by the good laws of the kingdom, and may hold
what he has by right." The officers of the crown and the great
noblemen also vowed fealty and homage: Henry IV. was king of
England.

In the first days of his reign, the new sovereign was enabled to
believe that public opinion fully confirmed his usurpation. All the
great noblemen were eager to fulfil at his coronation their
hereditary offices; the Earl of Northumberland alone, who had
rendered eminent services to him, marched beside him in the
procession, holding aloft in sight of all the sword worn by
Bolingbroke on landing at Ravenspur. The House of Commons
responded to the slightest wishes of the king, and the greater
number of the unpopular measures of the last reign were
withdrawn by common consent. A great uproar arose in the House
of Lords: the peers who had appealed against the Duke of
Gloucester were summoned to exculpate themselves; all took their
stand upon the wish of King Richard, upon the fear which he
inspired, and upon the unanimous vote of the House.
Recriminations poured down in every part; forty gauntlets were
thrown upon the ground as challenges to combat. A weak and
timid monarch would have taken alarm in the midst of this violent
confusion: Henry IV. was enabled to calm the agitation. He divested
the "lords appellant," as they were styled, of the titles which
Richard had given to them as rewards; the Dukes of Albemarle,
Surrey and Exeter, the Marquis of Dorset and the Earl of Gloucester,
became once more the Earls of Rutland, Kent, Huntingdon, and
Somerset, and Lord Le Despencer; but the new king wreaked no
other vengeance upon them. The high treason law was restored to
more limited and less vague formulae; appeals to the Houses in
cases of treason were abolished, and the Parliament was forbidden
to delegate its authority to a commission. The eldest son of the
king was declared Prince of Wales, Duke of Guienne, Lancaster, and
Cornwall, as well as heir presumptive to the throne. Henry was too
prudent to again raise the question of the law of succession which
he had so boldly disregarded: he did not wish his hereditary right
to the throne to be discussed; he well knew that the little Earl of
March, so carefully installed in Windsor Castle, was the real heir to
the throne, as great-grand-son of Lionel, Duke of Clarence, the
elder brother of John of Gaunt. The child was not nine years of
age; the king caused him to be well brought up, as well as his
brother, and neither was destined to recover his liberty during his
lifetime; but their sister, soon afterwards married to the Earl of
Cambridge, had transmitted to the House of York those rights or
those pretensions which condemned England to half a century of
civil war.

Difficulties abound in the path of usurpers. King Richard had not


protested, he had asked for nothing, but he still lived in the Tower.
Before dissolving the Parliament, King Henry IV. despatched the
Earl of Northumberland to the House of Lords. The latter asked
that the message with which he was entrusted should be kept
secret; he then consulted the House upon the manner in which the
dispossessed king was to be treated; "for my master Henry," he
added, "has resolved, at any cost, to preserve the life of Richard."
The Lords all replied that King Richard should be secretly led away
to some castle, and placed in the hands of faithful custodians, who
should prevent all communication with his friends. This was the
sanction which Henry IV. wished for; the dispossessed monarch was
conducted to Leeds Castle, in Kent, and then transferred by night
from castle to castle, as had been his great-grandfather, Edward II.
In the month of January, Richard had arrived in Pontefract Castle,
in Yorkshire.

The removal of the dethroned king could not suffice to strengthen


the power; conspiracies were already beginning. The lords appellant
had scarcely been punished, but their fears as well as their
resentment urged them to revenge. They had formed the project of
assassinating Henry and of replacing Richard upon the throne. A
tournament was announced at Oxford for the 3rd of January, and
the Earl of Huntingdon, the brother-in-law of the king, invited the
latter to be present thereat. The invitation was accepted. The
murder was to be accomplished during the jousts; the king and his
son were to succumb beneath numbers. The day came; the king
had not arrived, and the Earl of Rutland was absent from the place
of meeting. The conspirators saw themselves betrayed; but a bold
stroke might yet save them; they galloped to Windsor, and took
possession of the castle. The king was no longer there: warned in
time, he had taken refuge in London. The arrest warrants were
already issued against the traitors, and, on the morrow, Henry
marched against them, at the head of a considerable force. They
did not await him, and fled to arm their vassals. Civil war appeared
imminent; but public opinion was with King Henry: it administered
justice to the conspirators, without the king being obliged to
interfere. The citizens of the Cirencester seized the Earls of Kent
and Salisbury, and struck off their heads; Lord Le Despencer was
beheaded by the citizens of Bristol; the Earl of Huntingdon was
dismembered at Pleshy by the servants of the late Duke of
Gloucester. The King had only to cause the trial of a few
accomplices of low degree, but the attempt of the lords appellant
probably cost the life of King Richard; it was learnt, towards the
end of January, that he had died at Pontefract. It was related that
he had refused to take any food since the death of his brothers,
the Earls of Kent and Huntingdon; distrustful people asserted that
he had been starved to death. Others maintained that he had been
attacked in his prison by some assassins, and that, after having
valiantly defended himself, he had been killed by a blow behind the
head. When the body of the unhappy monarch was brought to
London, before being interred at Langley, a portion only of the face
was uncovered. The details of his death were forever unknown, and
many people were resolute in denying it.
The little Queen Isabel had remained in England during the lifetime
of her husband, notwithstanding her father's wish to see her return
to his side. The death of his son-in-law caused one of the dreaded
attacks of insanity to poor King Charles VI.; but his uncles were
anxious to profit by the indignation which was manifested at
Bordeaux, the birthplace of the deposed monarch; the Dukes of
Burgundy and Bourbon advanced towards Guienne, and the first
movement of the population was favorable to their wish. "Richard
was the best man in his kingdom," it was said at Bordeaux, "and
the people of London have treacherously abandoned him." But as
the French army advanced, the ardor of the Gascons abated. The
French were poor, and annoyed by subsidies and taxes, which were
sometimes reproduced upon two or three occasions during the year.
"We are not accustomed to be treated thus," said the English
subjects, "and it would be too hard upon us. We have still a king,
and he will send his ministers to us to explain himself. Meanwhile,
we have a large commerce with England, in wine, in wool, and in
cloth." The uncles of the king were compelled to retire without
having accomplished anything. Henry IV. was in no hurry to renew
the war with France; he caused a proposal to be made to marry
the little Queen to the Prince of Wales; but the father and the
daughter rejected this alliance. Charles VI. claimed with Isabel his
jewels and the two hundred thousand livres in gold which King
Richard had received upon her dowry. Henry was poor and the sum
considerable; when the young Queen was at length consigned to
her family, in the month of August, 1401, the ambassadors of
England replied to the claims of the French by a demand for a
hundred and fifty thousand crowns of gold which remained due
upon the ransom of King John the Good. The question of the dowry
of Isabel was no longer mooted, and peace subsisted between the
two countries during the greater part of the reign of Henry IV.,
notwithstanding the challenges of the Duke of Orleans and
Wallerand of Luxemboug, Count of Ligny and St. Pol, which gave
rise to slight hostilities upon the coasts. Good warrior as he was,
the King of England had too much to do at home, and too much
trouble to consolidate his throne to seek afar for hazardous
adventures.

At the very outset of his reign, however, and on the morrow of the
conspiracy of the lords appellant, Henry had attempted an
expedition into Scotland. Not daring to ask subsidies of the
Parliament, the king had had recourse to the military service of the
feudal system, and, convoking under his banners all holders of
fiefs, and furnished with the tithe voted by the clergy, he had
advanced as far as Edinburgh, to summon King Robert, the Duke of
Rothsay, his son, and all the great Scottish noblemen to come and
render homage to him. Robert III. was aged, feeble, and infirm; he
had abandoned the power to his brother, the Duke of Albany,
constantly at contention with the heir to the throne, the Duke of
Rothsay, sanguine, thoughtless, and venturesome. The young duke
hastened to Edinburgh, to defend it. Henry was repulsed; his
provisions failed him: he was compelled to withdraw from Scotland,
having reaped no other glory in this campaign than the humanity
towards the peasants, of which he had given proofs, and the
discipline which he had been enabled to maintain in his army.

While the King of England was fighting and suffering failure in


Scotland, an unexpected insurrection broke out in Wales. A lawyer,
who had afterwards served as esquire in the house of the Earl of
Arundel, a Welshman,—descending, it was said, from Llewellyn, the
last Welsh prince,—Owen Glendower or Glendwyr, had seen his
little estate encroached upon through the avidity of a powerful
neighbor, Lord Grey de Ruthyn. Owen had appealed to the
Parliament; his complaint had been rejected. The Welshman
resolved to avenge himself by force of arms, and drove from his
lands the servants of Lord Grey. He was thereupon outlawed. His
pretensions grew with his anger; it was no longer a question of a
little field or of a cluster of trees; Owen Glendwyr publicly
proclaimed his illustrious origin, laying claim to the independent
sovereignty of Wales. Fire smouldered under the ashes among
these people, subjected for so many years; the love of national
liberty was not extinguished. From all parts the Welsh hastened
round Owen; students quitted their universities, laborers their
ploughshares, at the call of independence. At the beginning of the
year 1401, King Henry IV. found himself compelled to proceed to
Wales with an army. But Owen was too shrewd to hazard a pitched
battle; he left to the climate and to famine the task of fighting for
him. From the mountains in which he had taken refuge, he soon
saw King Henry compelled to retire. A second campaign, attempted
in 1402, was not more fortunate: the rain fell in torrents; the rivers
became swollen at the approach of the English soldiers, who left
Wales convinced that Glendwyr was a sorcerer in league with the
elements.

The rumor that King Richard was still living had come once more to
be circulated in Scotland and in the North of England, restoring a
certain amount of courage to the malcontents. In vain had King
Henry severely punished the fomenters of this news; Richard was
expected with the Scottish army, when it entered into England in
the spring of 1402. At the head of the English opposition was a
Scotchman, George, Earl of March. The Duke of Rothsay was to
have married his daughter, but he had rejected her, to unite himself
with the family of the Earl of Douglas, the hereditary enemy of the
Earls of March. The Earl of March had thereupon renounced his
allegiance to the King of Scotland, and had allied himself with the
Percies, all powerful in the county of Northumberland. It was with
his assistance that the Scots were defeated and repulsed at Nesbit
Moor, in June, 1402. Internal rancors soon brought forward a
second army; the Earl of Douglas, furious at the success of his
rival, solicited the assistance of the Duke of Albany, and, at the
head of a considerable force, he soon overran the two banks of
Tyne. Having advanced as far as Newcastle, he was falling back,
loaded with booty, when the Earls of Northumberland and March
cut off his road on the 14th of September. The Scots covered
Homildon Hill, and the English were stationed opposite upon
another elevation. Hotspur Percy had already commanded the
charge of his men-at-arms, when the Earl of March restrained him
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like