内容简介
Part 1 Covering the Basics
1 Starting from Scratch
Before You Begin
Running Your First Script
Header Information
Reference Information
Worker Information
Output Information
Enhancing Your Script
Docs That Make House Calls
Modifying an Existing Script
Modifying the Header Information
Modifying the Reference Information
Modifying the Worker Information
Modifying the Output information
Summary
Quiz Yourself
On Your Own
Lab 1 Exploring a VBScript
Lab Instructions
Lab 2 Customizing an Existing Script
Scenario
Lab Instructions
2 Getting in the Loop
Before You Begin
Adding Power to Scripts
Header Information
Reference Information
Worker Information
For...Next
Header Information
Reference Information
Worker and Output Information
Do While...Loop
Header Information
Reference Information
Worker and Output Information
Do Until...Loop
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 3 Using the For Each...Next Command
Lab Instructions
Lab 4 Modifying the Ping Script
Lab Instructions
3 Adding Intelligence
Before You Begin
If...Then
Header Information
Reference Information
Worker and Output Information
Intrinsic Constants
If...Then...Elself
Header Information
Reference Information
Worker and Output Information
If...Then...Else
Select Case
Header Information
Reference Information
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 5 Modifying CPUType.vbs
Lab Instructions
Lab 6 Modifying ComputerRoles.vbs
Scenario
4 The Power of Many
Before You Begin
Passing Arguments
Command-Line Arguments
Making the Change
Running from the Command Prompt
No Arguments?
Creating a Useful Error Message
Using Multiple Arguments
Header Information
Reference Information
Worker and Output Information
Tell Me Your Name
Reasons for Named Arguments
Making the Change to Named Arguments
Running a Script with Named Arguments
Working with Arrays
Moving Past Lame Arrays
Header Information
Reference Information
Worker and Output Information
What Does UBound Mean?
Two-Dimensional Arrays
Mechanics of Two-Dimensional Arrays
Header Information
Reference Information
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 7 Working with Passing Arguments
Lab Instructions
Lab 8 Building Arrays
Lab Instructions
Lab 9 Modifying a Script
Lab Instructions
5 The Power of Many More
Before You Begin
Strings and Arrays
Parsing Passed Text into an Array
Header Information
Reference Information
Worker Information
Output Information
Parsing Passed Text
Header Information
Reference Information
Worker Information
Output Information
Working with Dictionaries
Using the Dictionary
Adding Items to the Dictionary
Summary
Quiz Yourself
Own Your Own
Lab 10a Implementing Basics for the InStr Command
Lab Instructions
Lab 10b Understanding Advanced Features of the InStr Command
Lab Instructions
Lab 11 Creating a Dictionary
Lab Instructions
Part 2 Basic Windows Administration
6 Working with the File System
Before You Begin
Creating File System Object
File It Under Files
Header Information
Reference Information
Worker and Output Information
File Properties
File Attributes
Implementing the Attributes Property
Setting File Attributes
A File,a File,I Need to Create a File
Writing to a Text File
How Shall I Write Thee?Let Me Count the Ways
Overwriting a File
Existential File Approaches
Summary
Quiz Yourself
On Your Own
Lab 12 Creating Files
Lab 13 Creating a Log File
7 Fun with Folders
Before You Begin
Working with Folders
Creating the Basic Folder
Header Information
Reference Information
Worker Information
Output Information
Automatic Cleanup
Deleting a Folder
Deleting Multiple Folders
Binding to Folders
Does the Folder Exist?
Copying Folders
Moving On Up
Summary
Quiz Yourself
On Your Own
Lab 14 Creating Folders
Lab 15 Deleting Folders
8 Why Windows Management Instrumentation?
Before You Begin
What IS WMI?
An Object in Any Other Namespace
More Than Just a Name
Providers
Adding a Touch of Class
Querying WMI
Header Information
Reference Information
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 16 Retrieving Hotfix Information
Lab Instructions
Lab 17 Echoing the Time Zone
Lab Instructions
9 WMI Continued
Before You Begin
Alternate Ways of Configuring the WMI Moniker
Accepting Defaults
Reference Information
Worker and Output Information
Moniker Security Settings
WbemPrivilege Has Its Privileges
Summary
Quiz Yourself
On Your Own
Lab 18a Using the Default WMI Moniker
Lab Instructions
Lab 18b Invoking the WMI Moniker to Display the Machine Boot Configuration
Lab Instructions
Lab 18c Including Additional Security Permissions
Lab Instructions
Lab 19 Using Win32_Environment and VBScript to Learn About WMI
Lab Instructions
10 Using WMI Queries
Before You Begin
Tell Me Everything About Everything!
Next
Header information
Reference Information
Worker and Output Information
Selective Data from All Instances
Selecting Multiple Properties
Specifying Specifics
Smooth Operator
Where Is the Where Clause?
Summary
Quiz Yourself
On Your Own
Lab 20 Writing an Informative WMI Script
Lab Instructions
Lab 21a Obtaining More Direct Information
Lab Instructions
Lab 21b Using a More Complicated Where Clause
Lab Instructions
Part 3 Advanced Windows Administration
11 Introduction to Active Directory Service Interfaces
Before You Begin
Working with ADSI
Reference Information
ADSI Providers
LDAP Names
Worker Information
Output Information
Creating Users
Reference Information
Worker Information
Output Information
Summary
Quiz Yourself
On Your Own
Lab 22 Creating OUs
Lab Instructions
Lab 23 Creating Multi-Valued Users
Lab Instructions
12 Reading and Writing for ADSI
Before You Begin
Working with Users
General User Information
Reference Information
Worker Information
Output Information
Creating the Second Page
Reference Information
Worker Information
Output Information
Deleting Users
Summary
Quiz Yourself
On Your Own
Lab 24 Deleting Users
Lab Instructions
Lab 25 Using the Event Log
Lab Instructions
13 Searching Active Directory
Before You Begin
Connecting to Active Directory to Perform a Search
Header Information
Reference Information
Worker and Output Information
Creating More Effective Queries
Searching for Specific Types of Objects
Reference Information
Output Information
What Is Global Catalog?
Summary
Quiz Yourself
On Your Own
Lab 26 Creating an ADO Query into Active Directory
Lab Instructions
Lab 27 Controlling How a Script Executes Against Active Directory
Lab Instructions
14 Configuring Networking Components
Before You Begin
WMI and the Network
Making the Connection
Header Information
Reference Information
Worker and Output Information
Changing the TCP/IP Settings
Header Information
Reference Information
Worker and Output Information
Merging WMI and ADSI
Win32_NetworkAdapterConfiguration
Summary
Quiz Yourself
On Your Own
Lab 28 Using WMI to Assign Network Settings
Lab Instructions
Lab 29 Combining WMI and ADSI in a Script
Lab Instructions
15 Subs and Other Round Things
Before You Begin
Working with Subroutines
Calling the Subroutine
Creating the Subroutine
Creating Users and Logging Results
Header Information
Reference Information
Worker Information
Output Information
Summary
Quiz Yourself
On Your Own
Lab 30 Using ADSI and Subs,and Creating Users
Lab Instructions
Lab 31 Adding a Logging Subroutine
Lab Instructions
16 Logon Scripts
Before You Begin
Working with IADsADSystemInfo
Using Logon Scripts
Deploying Logon Scripts
Header Information
Reference Information
Worker Information
Output Information
Summary
Quiz Yourself
On Your Own
Lab 32 Adding a Group to a Logon Script
Lab Instructions
Lab 33 Adding Logging to a Logon Script
Lab Instructions
17 Working with the Registry
Before You Begin
First You Back UP
Creating the WshShell Object
Setting the comspec Variable
Defining the Command Line
Connecting to the Registry
Header Information
Reference Information
Worker and Output Information
Unleashing StdRegProv
Creating Registry Keys
Header Information
Reference Information
Worker and Output Information
Writing to the Registry
Deleting Registry Information
Summary
Quiz Yourself
On Your Own
Lab 34 Reading the Registry Using WMI
Lab Instructions
Lab 35 Creating Registry Keys
Lab Instructions
18 Working with Printers
Before You Begin
Working with Win32_Printer
Obtaining the Status of Printers
Header Information
Reference Information
Worker Information
Output Information
Creating a Filtered Print Monitor
Reference Information
Output Information
Monitoring Print Queues
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 36 Monitoring Print Jobs
Lab Instructions
Lab 37 Checking the Status of a Print Server
Lab Instructions
Part 4 Scripting Other Applications
19 Managing IIS 6.0
Before You Begin
What's in a Name?
Using MicrosoftIISv2
Making the Connection
Header Information
Reference Information
Worker and Output Information
Creating a Website
Header Information
Reference Information
Worker and Output Information
Summary
Quiz Yourself
On Your Own
Lab 38 Backing Up the Metabase
Lab Instructions
Lab 39 Importing the Metabase
Lab Instructions
20 Working with Exchange 2003
Before You Begin
Working with the Exchange Provider
Connecting to MicrosoftExchangeV2
The Exchange_QueueSMTPVirtualServer Class
Header Information
Reference Information
Worker Information
Output Information
Exchange Public Folders
Summary
Quiz Yourself
On Your Own
Lab 40 Using the Exchange_Logon Class
Lab Instructions
Lab 41 Using the Exchange_Mailbox Class
Lab Instructions
Part 5 Appendices
A VBScript Documentation
Constants
VBScript Run-Time Errors
VBScript Syntax Errors
B ADSI Documentation
Computer Object Mapping
Domain Object User Interface Mapping
Group Object User Interface Mapping
Object Property Sheet
Organizational Unit User Interface Mapping
Printer Object User Interface Mapping
Shared Folder Object User Interface Mapping
User Object User Interface Mapping
C WMI Documentation
Win32 Classes
WMI Providers
WMI Scripting API Objects
WMI Log Files
D Documentation Standards
Header Information Section
Reference Information Section
Worker Information Section
Sample of Documentation Use
Index