Windows Powershell Unleashed [2nd edition] 9780672329883, 0672329883

PowerShell gives Windows administrators immense power to automate and customize virtually any administrative task-saving

1,405 325 5MB

English Pages 528 [529] Year 2008

Report DMCA / Copyright

DOWNLOAD FILE

Windows Powershell Unleashed [2nd edition]
 9780672329883, 0672329883

Table of contents :
Table of Contents......Page 5
Introduction......Page 20
Part I: Introduction to PowerShell......Page 24
What Is a Shell?......Page 26
A Shell History......Page 34
Enter PowerShell......Page 35
New Capabilities in PowerShell 2.0 CTP2......Page 37
Summary......Page 38
Getting Started......Page 40
Understanding the Command-Line Interface (CLI)......Page 47
Understanding Cmdlets......Page 51
Getting Help......Page 53
Understanding Variables......Page 58
Understanding Aliases......Page 61
Creating Your First Script......Page 64
Summary......Page 66
3 Advanced PowerShell Concepts......Page 68
Working with the .NET Framework......Page 70
Understanding the Pipeline......Page 78
The Extended Type System (ETS)......Page 84
Summary......Page 91
Formatting Output......Page 92
Providers......Page 98
Profiles......Page 106
Scopes......Page 107
Library Files......Page 110
Summary......Page 116
5 Understanding PowerShell Security......Page 118
Execution Policies......Page 119
Code Signing......Page 124
PowerShell Security Best Practices......Page 137
PowerShell 2.0 CTP2 and Windows Remote Management (WinRM)......Page 138
Summary......Page 144
Part II: Using PowerShell......Page 146
Expressions and Operators......Page 148
Escape Sequences......Page 162
Error Handling......Page 164
Managing Elements with Arrays......Page 170
Creating Functions......Page 176
Understanding Filters......Page 182
Controlling Script Flow with Loops......Page 183
Using Logic and Making Decisions......Page 186
Building Scripts with Scriptblocks......Page 189
Summary......Page 191
System.String......Page 192
[String] Type Accelerator......Page 193
Select-String Cmdlet......Page 194
Simple Operations......Page 196
System.String Members......Page 197
Wildcards......Page 204
Comparison Operators......Page 209
Regular Expressions......Page 210
Replace Operators......Page 211
[RegEx] Type Accelerator......Page 212
2.0 CTP: Join and Split......Page 213
Format Operator......Page 214
Summary......Page 215
Core Cmdlets......Page 216
Navigating the File System......Page 217
Managing Drives......Page 219
Managing Folders......Page 220
Managing Files......Page 224
Working with XML Files......Page 227
Working with CSV Files......Page 233
Scenario: Automating File System Management......Page 235
Summary......Page 244
WSH and Permissions......Page 246
PowerShell and Permissions......Page 250
Summary......Page 257
Registry Management in PowerShell......Page 258
Registry Transactions......Page 262
Simplifying Registry Management......Page 268
Using 2.0 CTP Features......Page 281
Summary......Page 284
11 PowerShell and WMI......Page 286
Comparing WMI Usage Between WSH and PowerShell......Page 288
Working with WMI......Page 293
PowerShell 2.0 Changes......Page 299
Scripting Scenario: MonitorMSVS.ps1......Page 304
Summary......Page 310
PowerShell Configuration and Usage Recommendations......Page 312
Script Development......Page 314
Script Design......Page 318
Standards for Scripting......Page 325
Summary......Page 330
Part III: Managing Microsoft Technologies with PowerShell......Page 332
Getting Started......Page 334
The PowerShell SDK......Page 335
Creating a Custom Cmdlet......Page 339
Creating a Custom Snap-In......Page 342
Creating Custom Parameters......Page 346
Advanced Parameter Functionality......Page 348
Input Validation......Page 351
Supporting Get-Help......Page 354
Runspaces......Page 360
Scenario: Geocoding in MMC 3.0......Page 363
Summary......Page 371
Understanding the Interfaces......Page 372
Managing Objects......Page 380
Searching for Objects......Page 386
Scripting Scenario: ChangeLocalAdminPassword.ps1......Page 392
Summary......Page 405
15 PowerShell and Exchange Server 2007......Page 406
Accessing the Exchange Management Shell (EMS)......Page 407
Using the Exchange Management Shell......Page 408
Scripting Scenario: GetDatabaseSizeReport.ps1......Page 416
Scripting Scenario: GetEvent1221Info.ps1......Page 425
Scripting Scenario: ProvisionExchangeUsers.ps1......Page 435
Summary......Page 442
Operations Manager PowerShell Integration......Page 444
The Object Tree......Page 446
Agent Cmdlets......Page 451
Task Cmdlets......Page 455
Management Server Cmdlets......Page 460
Maintenance Mode Cmdlets......Page 466
Comprehensive Operations Manager Cmdlet List......Page 471
Summary......Page 475
17 PowerShell 2.0 Features......Page 476
Remoting......Page 477
Background Jobs......Page 485
Graphical PowerShell......Page 487
Script Cmdlets......Page 488
Out-GridView Cmdlet......Page 490
Script Internationalization......Page 491
DATA Sections......Page 492
Script Debugging......Page 494
Summary......Page 496
A: The PSShell.ps1 Script......Page 498
Component One: Shell Replacement......Page 499
Step Two: Configuring the Windows Shell Replacement Settings......Page 500
Component Two: PSShell.exe......Page 501
Component Three: PSShell.ps1......Page 503
Putting It All Together......Page 508
A......Page 510
C......Page 512
D......Page 513
E......Page 514
F......Page 515
G......Page 516
I......Page 517
M......Page 518
N......Page 519
O......Page 520
P......Page 521
Q-R......Page 522
S......Page 523
T......Page 526
W......Page 527
X-Y-Z......Page 528

Polecaj historie