Automating Administration with Windows PowerShell xiii
Contents
Module 1: Getting started with Windows PowerShell
Module Overview 1-1
Lesson 1: Overview and background of Windows PowerShell 1-2
Lab A: Configuring Windows PowerShell 1-12
Lesson 2: Understanding command syntax 1-15
Lesson 3: Finding commands 1-24
Lab B: Finding and running basic commands 1-30
Module Review and Takeaways 1-33
Module 2: Cmdlets for administration
Module Overview 2-1
Lesson 1: Active Directory administration cmdlets 2-2
Lesson 2: Network configuration cmdlets 2-13
Lesson 3: Other server administration cmdlets 2-19
Lab: Windows administration 2-24
Module Review and Takeaways 2-28
Module 3: Working with the Windows PowerShell pipeline
Module Overview 3-1
Lesson 1: Understanding the pipeline 3-2
Lesson 2: Selecting, sorting, and measuring objects 3-8
Lab A: Using the pipeline 3-16
Lesson 3: Filtering objects out of the pipeline 3-19
Lab B: Filtering objects 3-25
Lesson 4: Enumerating objects in the pipeline 3-28
Lab C: Enumerating objects 3-32
Lesson 5: Sending pipeline data as output 3-34
Lab D: Sending output to a file 3-39
Module Review and Takeaways 3-41
Module 4: Understanding how the pipeline works
Module Overview 4-1
Lesson 1: Passing pipeline data 4-2
Lesson 2: Advanced techniques for passing pipeline data 4-8
Lab: Working with pipeline parameter binding 4-13
Module Review and Takeaways 4-16
xiv Automating Administration with Windows PowerShell
Module 5: Using PSProviders and PSDrives
Module Overview 5-1
Lesson 1: Using PSProviders 5-2
Lesson 2: Using PSDrives 5-5
Lab: Using PSProviders and PSDrives 5-14
Module Review and Takeaways 5-18
Module 6: Querying management information by using CIM and WMI
Module Overview 6-1
Lesson 1: Understanding CIM and WMI 6-2
Lesson 2: Querying data by using CIM and WMI 6-7
Lesson 3: Making changes by using CIM and WMI 6-15
Lab: Working with CIM and WMI 6-19
Module Review and Takeaways 6-23
Module 7: Working with variables, arrays, and hash tables
Module Overview 7-1
Lesson 1: Using variables 7-2
Lesson 2: Manipulating variables 7-9
Lesson 3: Manipulating arrays and hash tables 7-15
Lab: Working with variables 7-23
Module Review and Takeaways 7-27
Module 8: Basic scripting
Module Overview 8-1
Lesson 1: Introduction to scripting 8-2
Lesson 2: Scripting constructs 8-11
Lesson 3: Importing data from files 8-17
Lab: Basic scripting 8-22
Module Review and Takeaways 8-28
Module 9: Advanced scripting
Module Overview 9-1
Lesson 1: Accepting user input 9-2
Lesson 2: Overview of script documentation 9-9
Lab A: Accepting data from users 9-13
Lesson 3: Troubleshooting and error handling 9-16
Lesson 4: Functions and modules 9-24
Lab B: Implementing functions and modules 9-30
Module Review and Takeaways 9-33
Automating Administration with Windows PowerShell xv
Module 10: Administering remote computers
Module Overview 10-1
Lesson 1: Using basic Windows PowerShell remoting 10-3
Lesson 2: Using advanced Windows PowerShell remoting techniques 10-13
Lab A: Using basic remoting 10-19
Lesson 3: Using PSSessions 10-22
Lab B: Using PSSessions 10-28
Module Review and Takeaways 10-31
Module 11: Using background jobs and scheduled jobs
Module Overview 11-1
Lesson 1: Using background jobs 11-2
Lesson 2: Using scheduled jobs 11-9
Lab: Using background jobs and scheduled jobs 11-16
Module Review and Takeaways 11-20
Module 12: Using advanced Windows PowerShell techniques
Module Overview 12-1
Lesson 1: Creating profile scripts 12-2
Lesson 2: Using advanced techniques 12-5
Lab: Practicing advanced techniques 12-17
Module Review and Takeaways 12-22
Lab Answer Keys
Module 1 Lab A: Configuring Windows PowerShell L1-1
Module 1 Lab B: Finding and running basic commands L1-3
Module 2 Lab: Windows administration L2-9
Module 3 Lab A: Using the pipeline L3-13
Module 3 Lab B: Filtering objects L3-17
Module 3 Lab C: Enumerating objects L3-20
Module 3 Lab D: Sending output to a file L3-22
Module 4 Lab: Working with pipeline parameter binding L4-25
Module 5 Lab: Using PSProviders and PSDrives L5-27
Module 6 Lab: Working with CIM and WMI L6-31
Module 7 Lab: Working with variables L7-37
Module 8 Lab: Basic scripting L8-41
Module 9 Lab A: Accepting data from users L9-45
Module 9 Lab B: Implementing functions and modules L9-46
xvi Automating Administration with Windows PowerShell
Module 10 Lab A: Using basic remoting L10-49
Module 10 Lab B: Using PSSessions L10-52
Module 11 Lab: Using background jobs and scheduled jobs L11-57
Module 12 Lab: Practicing advanced techniques L12-51