rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780321213341

Managing Windows® with VBScript and WMI

by
  • ISBN13:

    9780321213341

  • ISBN10:

    0321213343

  • Edition: 1st
  • Format: Paperback w/CD
  • Copyright: 2004-01-01
  • Publisher: Addison-Wesley Professional
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $64.99

Summary

bull; Demystifies scripting for administrators, showing how VBScript and WMI can help ease repetitive or complex tasks bull; Organized around tasks, and heavily cross-referenced, allowing quick access to information of immediate value bull; Based on the author's years of experience teaching and training bull; Most other books on scripting focus on developers, not administrators

Author Biography

Don Jones, MCSE, CTT+, is an independent consultant and founding partner of BrainCore.Net

Table of Contents

Prefacep. xxi
Acknowledgmentsp. xxxv
About the Authorp. xxxvii
Introduction to Windows Administrative Scriptingp. 1
Scripting Concepts and Terminologyp. 3
What Is Scripting?p. 3
Script Hostsp. 4
ActiveX Scripting Languagesp. 6
The Component Object Model (COM)p. 9
Critical Scripting Security Issuesp. 9
Reviewp. 10
Running Scriptsp. 11
Windows Script Hostp. 11
Command-Line Scriptsp. 13
Notepad and Script Editorsp. 16
Writing Your First Scriptp. 23
Running Your First Scriptp. 25
Debugging Your First Scriptp. 25
Reviewp. 26
The Components of a Scriptp. 29
A Typical VBScriptp. 29
Functionsp. 32
Subroutinesp. 33
Main Scriptp. 34
Comments and Documentationp. 40
Reviewp. 45
Designing a Scriptp. 47
Creating a Task Listp. 48
Selecting the Appropriate Toolsp. 50
Creating Modules to Perform Tasksp. 57
Validating User Inputp. 63
Planning for Errorsp. 63
Creating Script Librariesp. 66
Reviewp. 66
Vbscript Tutorialp. 69
Functions, Objects, Variables, and Morep. 71
What Are Variables?p. 72
What Are Functions?p. 82
What Are Statements and Subroutines?p. 89
What Are Objects?p. 92
Reviewp. 97
Input and Outputp. 99
Displaying Messagesp. 99
Asking for Inputp. 107
Command-Line Parameters as Inputp. 110
Reviewp. 114
Manipulating Numbersp. 117
Numbers in VBScriptp. 117
Basic Arithmeticp. 118
Advanced Arithmeticp. 121
Boolean Mathp. 124
Converting Numeric Data Typesp. 129
Converting Other Data Types to Numeric Datap. 130
Reviewp. 130
Manipulating Stringsp. 133
Strings in VBScriptp. 133
Working with Substringsp. 135
Concatenating Stringsp. 139
Changing Stringsp. 141
Formatting Stringsp. 143
Converting Other Data Types to String Datap. 144
Reviewp. 145
Manipulating Other Types of Datap. 147
Working with Dates and Timesp. 147
Working with Arraysp. 150
Working with Bytesp. 155
Reviewp. 156
Controlling the Flow of Executionp. 157
Conditional Executionp. 158
Loopsp. 164
Putting It All Togetherp. 170
Reviewp. 173
Built-in Scripting Objectsp. 175
The WScript Objectp. 175
The Network Objectp. 176
The Shell Objectp. 183
The Shortcut Objectp. 190
Reviewp. 192
Working with the File Systemp. 193
The FileSystemObject Libraryp. 193
Working with Drivesp. 194
Working with Foldersp. 197
Working with Filesp. 204
Reading and Writing Text Filesp. 207
Other FSO Methods and Propertiesp. 211
Creating a Log File Scannerp. 212
Reviewp. 221
Putting It All Together: Your First Scriptp. 223
Designing the Scriptp. 224
Writing Functions and Subroutinesp. 227
Writing the Main Scriptp. 232
Testing the Scriptp. 240
Reviewp. 251
Windows Management Instrumentation and Active Directory Services Interfacep. 253
Working with ADSI Providersp. 255
Using ADSI Objectsp. 255
Using the WinNT Providerp. 257
Using the LDAP Providerp. 260
Other Providersp. 263
Reviewp. 263
Manipulating Domainsp. 265
Querying Domain Informationp. 265
Changing Domain Settingsp. 267
Working with OUsp. 268
Putting It All Togetherp. 273
Reviewp. 279
Manipulating Users and Groupsp. 281
Creating Users and Groupsp. 281
Querying User Informationp. 284
Changing User Settingsp. 285
Working with Groupsp. 286
Putting It All Togetherp. 288
Reviewp. 292
Understanding WMIp. 293
The WMI Hierarchyp. 293
Exploring WMI's Capabilitiesp. 296
Installing WMIp. 301
Using the WMI Toolsp. 302
Really--It's This Easyp. 304
Reviewp. 309
Querying Basic WMI Informationp. 311
The WMI Query Language (WQL)p. 311
Determining What to Queryp. 316
Testing the Queryp. 319
Writing the Query in VBScriptp. 321
Using the Query Resultsp. 326
Alternative Methodsp. 328
Reviewp. 329
Querying Complex WMI Informationp. 331
Understanding WMI Relationshipsp. 331
Associating WMI Instancesp. 336
Writing the Queryp. 340
Testing the Queryp. 341
Writing the Query in VBScriptp. 341
Another Examplep. 345
Reviewp. 349
Putting It All Together: Your First WMI/ADSI Scriptp. 351
Designing the Scriptp. 351
Writing Functions and Subroutinesp. 357
Writing the Main Scriptp. 360
Testing the Scriptp. 369
Reviewp. 374
Creating Administrative Web Pagesp. 375
Active Server Pages Crash Coursep. 377
About ASPp. 378
VBScript in ASPp. 379
The Response Objectp. 381
The Request Objectp. 384
A Sample ASP Scriptp. 385
Testing ASP Scriptsp. 389
Reviewp. 391
Adding Administrative Script to a Web Pagep. 393
The Basic Web Pagep. 393
Adding Functions and Subroutinesp. 396
Adding Inline Scriptp. 397
The Resultp. 403
Reviewp. 417
Web Page Security Overviewp. 419
The ASP Security Contextp. 419
Prohibited Behaviorsp. 423
IIS 4.0, 5.0, and 5.1 versus IIS 6.0p. 424
NTFS and IIS Securityp. 427
Writing Secure ASP Codep. 427
Reviewp. 431
Putting It All Together: Your First Administrative Web Pagesp. 433
Checking User Account Statusp. 433
Administering IISp. 443
Reviewp. 460
Advanced Scripting Techniquesp. 461
Modular Script Programmingp. 463
Introduction to Windows Script Componentsp. 463
Scripting and XMLp. 465
Reviewp. 474
Using Script Componentsp. 475
Obtaining the Componentp. 475
Reviewing the Componentp. 476
Using the Componentp. 477
Reviewp. 479
Encoded Scriptsp. 481
Installing the Script Encoderp. 482
Writing Encoded Scriptsp. 482
Running Encoded Scriptsp. 485
Reviewp. 486
Scripting Securityp. 487
Why Scripting Can Be Dangerousp. 487
Security Improvements in Windows XP and Windows Server 2003p. 488
Digitally Signing Scriptsp. 490
Running Only Signed Scriptsp. 493
Ways to Implement Safe Scriptingp. 494
Reviewp. 495
Ready-to-Run Examplesp. 497
Logon and Logoff Scriptsp. 499
NT and Active Directory Logon Scriptsp. 500
Active Directory-Specific Logon Scriptsp. 507
Active Directory Logoff Scriptsp. 513
Reviewp. 516
Windows and Domain Administration Scriptsp. 517
Automating User Creationp. 517
Finding Inactive Usersp. 527
Collecting System Informationp. 533
Reviewp. 539
Network Administration Scriptsp. 541
Shutting Down Remote Computersp. 541
Listing Remote Sharesp. 544
Finding Out Who Has a File Openp. 547
Uninstall Remote MSI Packagesp. 549
Adding Users from Excelp. 553
Listing Hot Fixes and Softwarep. 562
Reviewp. 566
WMI and ADSI Scriptsp. 567
The All-Purpose WMI Query Scriptp. 567
The All-Purpose WMI Update Scriptp. 569
The All-Purpose ADSI Object Creation Scriptp. 571
The All-Purpose ADSI Object Query Scriptp. 572
The All-Purpose ADSI Object Deletion Scriptp. 573
Mass Password Changes with ADSIp. 574
Reviewp. 576
Appendixp. 577
Administrator's Quick Script Referencep. 579
Indexp. 591
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

Microsoft introduced Visual Basic, Scripting Edition--commonly known as VBScript--in the mid-'90s, positioning it as a native replacement for Windows' aging command-line batch language, which was based on Microsoft's earliest operating system, MS-DOS. VBScript was intended to be easy to learn, powerful, and flexible. The language was included as an add-on to Windows 95 and Windows NT 4.0, was an optional installation component included in Windows 98, and was included in all editions of Windows Me, Windows 2000, Windows XP, and Windows Server 2003. Software developers immediately seized upon VBScript for Web programming, particularly in Active Server Pages, Microsoft's rapid-development programming framework for the Web. However, Windows administrators--one of VBScript's initial target audiences--were left cold. VBScript seemed to be much more complicated than administrators' beloved MS-DOS-based batch language, and many didn't see the need to learn an entirely new batch language. When Windows 2000 and Active Directory came along, however, administrators found that Windows administration had become a great deal more complex. Suddenly, administrators were searching for Resource Kit and other utilities that offered automated administration, especially for repetitive tasks. Active Directory enabled the use of VBScript for logon and logoff scripts, which seemed to promise more advanced use environment manipulation. At around the same time, Microsoft's naivete in releasing a powerful language like VBScript with absolutely no security controls resulted in a huge wave of high-impact VBScript-based viruses, forcing administrators to lock down their environments and remove VBScript as an option both for viruses and for administrative tools. As a regular speaker at some of the country's top technical conferences that focus on Windows technologies, including MCP TechMentor, the past few years I've given half- and full-day sessions on VBScripting for Windows administrators, and the sessions have been incredibly popular. In these sessions, I try to provide just enough VBScript experience to make scripting possible, and then concentrate on accomplishing common administrative tasks with VBScript. I also cover the security concerns of VBScript and provide administrators with the means for safely using VBScript in their environments. This book is essentially a written form of those sessions, greatly expanded with more coverage of Windows Management Instrumentation and other advanced topics, and with more coverage of VBScript security issues and resolutions. I'm not out to turn you into a programmer. In fact, one of the real successes of VBScript is that you don't need to be a programmer to use it. Most of what you'll be doing in this book involves using VBScript to tell Windows to do things for you; you'll be able to ignore much of VBScript's complexity, using it as a sort of electronic glue to combine various operating system functions. Who Should Read This Book? The only assumption I have about you is that you already know how to administer some version of Microsoft Windows. You'll find that most of the material in this book is suitable for Windows NT, Windows 2000, and Windows Server 2003 environments, and it will continue to be useful through future versions of Windows. I do not assume that you have any background in programming, and I'm not going to give you a programming background. You should have a desire to learn how to use what I call "the batch language of the twenty-first century" and a wish to move away from clumsier--and often more complex--batch files based on the MS-DOS batch language. Although some folks like to refer to batch files as scripts, I don't; and when you see how easy and flexible VBScript is, you'll understand why! How to Use This Book You can read th

Rewards Program