Apply best practices for automating system administration with Windows PowerShell 2.0 and optimize your operational efficiency and results. This guide captures the field-tested tips, real-world lessons, and candid advice of practitioners across the range of business and technical scenarios and across the scripting life cycle. Discover how to:
Take advantage of new features and cmdlets in Windows PowerShell 2.0
Plan scripting usage scenarios and define standards Deploy Windows PowerShell 2.0 to desktops and servers
Configure scripting environments
Optimize remote scripting capabilities
Work with Active Directory(r) and WMI
Design functions and modules
Optimize input and output
Test and troubleshoot scripts
Avoid scripting pitfalls
The companion CD includes a fully searchable eBook and sample scripts.
A Note Regarding the CD or DVD:
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via O'Reilly Media's Digital Distribution services. To download this content, please visit O'Reilly's web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to firstname.lastname@example.org.
Chapter 1 Assessing the Scripting Environment
Why Use Windows PowerShell 2.0?
Comparison with Windows PowerShell 1.0
New Features of Windows PowerShell 2.0
Comparing Windows PowerShell 2.0 to VBScript
Deployment Requirements for Windows PowerShell 2.0
Deploying Windows PowerShell 2.0
Chapter 2 Survey of Windows PowerShell Capabilities
Using the Interactive Command Line
Working with WMI
Chapter 3 Survey of Active Directory Capabilities
Creating Users, Groups, and Organizational Units
Deriving the Create Object Pattern
Configuring the Connection to the Database
Chapter 4 User Management
Examining the Active Directory Schema
Querying Active Directory
Performing Account Management
Chapter 5 Identifying Scripting Opportunities
Automating Routine Tasks
Chapter 6 Configuring the Script Environment
Configuring a Profile
Creating a Profile
Accessing Functions in Other Scripts
Chapter 7 Avoiding Scripting Pitfalls
Lack of cmdlet Support
Version Compatibility Issues
Lack of WMI Support
Working with Objects and Namespaces
Listing WMI Providers
Working with WMI Classes
Lack of .NET Framework Support
Chapter 8 Tracking Scripting Opportunities
Evaluating the Need for the Script
Calculating the Benefit from the Script
Chapter 9 Designing Functions
Using Functions to Provide Ease of Code Reuse
Using More than Two Input Parameters
Using Functions to Encapsulate Business Logic
Using Functions to Provide Ease of Modification
Chapter 10 Designing Help for Scripts
Adding Help Documentation to a Script with Single-Line Comments
Using the Here-String for Multiple-Line Comments
Using Multiple-Line Comment Tags in Windows PowerShell 2.0
Ed Wilson is a well-known scripting expert who delivers popular scripting workshops to Microsoft customers and employees worldwide. He's written several books on Windows scripting, including Microsoft Windows PowerShell Step by Step and Microsoft VBScript Step by Step. Ed is a senior consultant at Microsoft Corporation.
Comments about Microsoft Press Windows PowerShell™ 2.0 Best Practices:
I'm just beginning to read this book and I thought I'd add my first impressions. I'm a SQL Server DBA and I'm looking to learn Powershell as a means of remotely administering my servers. I've only used Powershell briefly so I'm far from an expert. I'm hopeful this book will help my understanding.
First off, this book is not a book for beginners. A background in Powershell is helpful. I'm having to look up some of the concepts. But that's not the fault of the book, and the authors say as much in the Introduction. My only suggestion for other Powershell beginners is to read Chapter 6, on configuring the environment, first.
I've finished the first two chapters so far and I find the book is well written and informative. Chapter 1 is about Version 2, what's new, and how to deploy it on different OS's. It also shows how to use a version tag for backwards compatibility with version 1. Chapter 2 shows how to use WMI functionality and how remoting works. Remoting is also new to Version 2.
There's 2 things that make this book invaluable as a reference. First, the appendices are full of great information. For example, Appendix A lists all the cmdlets in Version 2 with a short description. Second, on the companion CD, there's a Quick Reference Guide pdf file that summarizes the points of each chapter.
I'll update my review after I finish the book.
Bottom Line Yes, I would recommend this to a friend