Cover
Copyright Page
Dedication
Contents at a Glance
Table of Contents
Acknowledgments
Introduction
Is This Book for Me?
About the Companion CD
System Requirements
Technical Support
Chapter 1: The Shell in Windows PowerShell
Installing Windows PowerShell
Verifying Installation with VBScript
Deploying Windows PowerShell
Interacting with the Shell
Introducing Cmdlets
Configuring Windows PowerShell
Creating a Windows PowerShell Profile
Configuring Windows PowerShell Startup Options
Security Issues with Windows PowerShell
Controlling the Execution of Cmdlets
Confirming Commands
Suspending Confirmation of Cmdlets
Supplying Options for Cmdlets
Working with Get-Help
Working with Aliases to Assign Shortcut Names to Cmdlets
Additional Uses of Cmdlets
Using the Get-ChildItem Cmdlet
Formatting Output
Using the Get-Command Cmdlet
Exploring with the Get-Member Cmdlet
Summary
Chapter 2: Scripting Windows PowerShell
Why Use Scripting?
Configuring the Scripting Policy
Running Windows PowerShell Scripts
Use of Variables
Use of Constants
Using Flow Control Statements
Adding Parameters to ForEach-Object
Using the Begin Parameter
Using the Process Parameter
Using the End Parameter
Using the For Statement
Using Decision-Making Statements
Using If … Elseif … Else
Using Switch
Working with Data Types
Unleashing the Power of Regular Expressions
Using Command-Line Arguments
Summary
Chapter 3: Managing Logs
Identifying the Event Logs
Reading the Event Logs
Exporting to Text
Export to XML
Perusing General Log Files
Examining Multiple Logs
Retrieving a Single Event Log Entry
Searching the Event Log
Filtering on Properties
Selecting the Source
Selecting the Severity
Selecting the Message
Managing the Event Log
Identifying the Sources
Modifying the Event Log Settings
Examining WMI Event Logs
Making Changes to the WMI Logging Level
Using the Windows Event Command-Line Utility
Writing to Event Logs
Creating a Source
Putting Cmdlet Output into the Log
Creating Your Own Event Logs
Summary
Chapter 4: Managing Services
Documenting the Existing Services
Working with Running Services
Writing to a Text File
Writing to a Database
Setting the Service Configuration
Accepting Command-Line Arguments
Stopping Services
Performing a Graceful Stop
Starting Services
Performing a Graceful Start
Desired Configuration Maintenance
Verifying Desired Services Are Stopped
Reading a File to Check Service Status
Verifying Desired Services Are Running
Confirming the Configuration
Producing an Exception Report
Summary
Chapter 5: Managing Shares
Documenting Shares
Documenting User Shares
Writing Shares to Text
Documenting Administrative Shares
Writing Share Information to a Microsoft Access Database
Auditing Shares
Modifying Shares
Using Parameters with the Script
Translating the Return Code
Creating New Shares
Creating Multiple Shares
Deleting Shares
Deleting Only Unauthorized Shares
Summary
Chapter 6: Managing Printing
Inventorying Printers
Querying Multiple Computers
Logging to a File
Writing to a Microsoft Access Database
Reporting on Printer Ports
Identifying Printer Drivers
Installing Printer Drivers
Installing Printer Drivers Found on Your Computer
Installing Printer Drivers Not Found on Your Computer
Summary
Chapter 7: Desktop Maintenance
Maintaining Desktop Health
Inventorying Drives
Writing Disk Drive Information to Microsoft Access
Working with Partitions
Matching Disks and Partitions
Working with Logical Disks
Monitoring Disk Space Utilization
Logging Disk Space to a Database
Monitoring File Longevity
Monitoring Performance
Using Performance Counter Classes
Identifying Sources of Page Faults
Summary
Chapter 8: Networking
Working with Network Settings
Reporting Networking Settings
Working with Adapter Configuration
Filtering Only Properties that Have a Value
Configuring Network Adapter Settings
Detecting Multiple Network Adapters
Writing Network Adapter Information to a Microsoft Excel Spreadsheet
Identifying Connected Network Adapters
Setting Static IP Address
Enabling DHCP
Configuring the Windows Firewall
Reporting Firewall Settings
Configuring Firewall Settings
Summary
Chapter 9: Configuring Desktop Settings
Working with Desktop Configuration Issues
Setting Screen Savers
Auditing Screen Savers
Listing Only Properties with Values
Reporting Secure Screen Savers
Managing Desktop Power Settings
Changing the Power Scheme
Summary
Chapter 10: Managing Post-Deployment Issues
Setting the Time
Setting the Time Remotely
Logging Results to the Event Log
Configuring the Time Source
Using the Net Time Command
Querying the Registry for the Time Source
Enabling User Accounts
Creating a Local User Account
Creating a Local User
Creating a Local User Group
Configuring the Screen Saver
Renaming the Computer
Shutting Down or Rebooting a Remote Computer
Summary
Chapter 11: Managing User Data
Working with Backups
Configuring Offline Files
Enabling the Use of Offline Files
Working with System Restore
Retrieving System Restore Settings
Listing Available System Restore Points
Summary
Chapter 12: Troubleshooting Windows
Troubleshooting Startup Issues
Examining the Boot Configuration
Examining Startup Services
Displaying Service Dependencies
Examining Startup Device Drivers
Investigating Startup Processes
Investigating Hardware Issues
Troubleshooting Network Issues
Summary
Chapter 13: Managing Domain Users
Creating Organizational Units
Creating Domain Users
Modifying User Attributes
Modifying General User Information
Modifying the Address Tab
Modifying the Profile Tab
Modifying the Telephone Tab
Modifying the Organization Tab
Modifying a Single User Attribute
Creating Users from a .csv File
Setting the Password
Enabling the User Account
Creating Domain Groups
Adding a User to a Domain Group
Adding Multiple Users with Multiple Attributes
Summary
Chapter 14: Configuring the Cluster Service
Examining the Clustered Server
Reporting Cluster Configuration
Reporting Node Configuration
Querying Multiple Cluster Classes
Managing Nodes
Adding and Evicting Nodes
Removing the Cluster
Summary
Chapter 15: Managing Internet Information Services
Enabling Internet Information Services Management
Reporting IIS Configuration
Reporting Site Information
Reporting on Application Pools
Reporting on Application Pool Default Values
Reporting Site Limits
Listing Virtual Directories
Creating a New Web Site
Creating a New Application Pool
Starting and Stopping Web Sites
Summary
Chapter 16: Working with the Certificate Store
Locating Certificates in the Certificate Store
Listing Certificates
Locating Expired Certificates
Identifying Certificates about to Expire
Managing Certificates
Inspecting a Certificate
Importing a Certificate
Deleting a Certificate
Summary
Chapter 17: Managing the Terminal Services Service
Configuring the Terminal Service Installation
Documenting Terminal Service Configuration
Disabling Logons
Modifying Client Properties
Managing Users
Enabling Users to Access the Server
Configuring Client Settings
Summary
Chapter 18: Configuring Network Services
Reporting DNS Settings
Configuring DNS Logging Settings
Reporting Root Hints
Querying “ A” Records
Configuring DNS Server Settings
Reporting DNS Zones
Creating DNS Zones
Managing WINS and DHCP
Summary
Chapter 19: Working with Windows Server 2008 Server Core
Initial Configuration
Joining the Domain
Setting the IP Address
Configuring the DNS Settings
Renaming the Server
Managing Windows Server 2008 Server Core
Monitoring the Server
Querying Event Logs
Summary
Appendix A: Cmdlet Naming Conventions
Appendix B: ActiveX Data Object Provider Names
Appendix C: Frequently Asked Questions
Appendix D: Scripting Guidelines
General Script Construction
Include Functions in the Script that Calls the Function
Use Full Cmdlet Names and Full Parameter Names
Use Get-Item to Convert Path Strings to Rich Types
General Script Readability
Formatting Your Code
Working with Functions
Creating Template Files
Writing Functions
Creating and Naming Variables and Constants
Appendix E: General Troubleshooting Tips
Index
About the Author