Windows PowerShell(TM) Scripting Guide
معرفی کتاب «Windows PowerShell(TM) Scripting Guide» نوشتهٔ Mike Volodarsky; Dan Holme; Ed Wilson; Stan Reimer; Joseph Davies; Anthony Northrup; Jesper M. Johansson; Microsoft Windows Server Team; Microsoft IIS Team; Microsoft Active Directory Team; Microsoft Networking Team; Microsoft Security Team، منتشرشده توسط نشر Microsoft Press در سال 2008. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Windows PowerShell(TM) Scripting Guide» در دستهٔ بدون دستهبندی قرار دارد.
Cover......Page 1 Copyright Page......Page 2 Dedication......Page 3 Contents at a Glance......Page 5 Table of Contents......Page 7 Acknowledgments......Page 17 Is This Book for Me?......Page 19 About the Companion CD......Page 20 Technical Support......Page 21 Verifying Installation with VBScript......Page 23 Deploying Windows PowerShell......Page 24 Interacting with the Shell......Page 25 Introducing Cmdlets......Page 27 Configuring Windows PowerShell Startup Options......Page 28 Controlling the Execution of Cmdlets......Page 29 Confirming Commands......Page 31 Suspending Confirmation of Cmdlets......Page 32 Supplying Options for Cmdlets......Page 33 Working with Get-Help......Page 34 Working with Aliases to Assign Shortcut Names to Cmdlets......Page 37 Additional Uses of Cmdlets......Page 38 Formatting Output......Page 39 Using the Get-Command Cmdlet......Page 46 Exploring with the Get-Member Cmdlet......Page 49 Summary......Page 53 Why Use Scripting?......Page 55 Configuring the Scripting Policy......Page 58 Use of Variables......Page 61 Use of Constants......Page 62 Using Flow Control Statements......Page 63 Using the Begin Parameter......Page 64 Using the For Statement......Page 65 Using Decision-Making Statements......Page 66 Using If … Elseif … Else......Page 67 Using Switch......Page 68 Working with Data Types......Page 71 Unleashing the Power of Regular Expressions......Page 75 Using Command-Line Arguments......Page 78 Summary......Page 80 Identifying the Event Logs......Page 81 Reading the Event Logs......Page 82 Exporting to Text......Page 83 Export to XML......Page 84 Perusing General Log Files......Page 86 Examining Multiple Logs......Page 87 Retrieving a Single Event Log Entry......Page 88 Searching the Event Log......Page 90 Selecting the Source......Page 91 Selecting the Message......Page 92 Modifying the Event Log Settings......Page 93 Examining WMI Event Logs......Page 97 Using the Windows Event Command-Line Utility......Page 98 Creating a Source......Page 99 Putting Cmdlet Output into the Log......Page 100 Creating Your Own Event Logs......Page 101 Summary......Page 102 Documenting the Existing Services......Page 103 Working with Running Services......Page 104 Writing to a Text File......Page 105 Writing to a Database......Page 107 Setting the Service Configuration......Page 116 Stopping Services......Page 119 Performing a Graceful Stop......Page 121 Starting Services......Page 123 Performing a Graceful Start......Page 124 Desired Configuration Maintenance......Page 129 Verifying Desired Services Are Stopped......Page 130 Reading a File to Check Service Status......Page 131 Confirming the Configuration......Page 132 Producing an Exception Report......Page 133 Summary......Page 135 Documenting Shares......Page 137 Documenting User Shares......Page 144 Writing Shares to Text......Page 147 Writing Share Information to a Microsoft Access Database......Page 148 Auditing Shares......Page 152 Modifying Shares......Page 155 Using Parameters with the Script......Page 156 Translating the Return Code......Page 157 Creating New Shares......Page 159 Creating Multiple Shares......Page 163 Deleting Shares......Page 165 Deleting Only Unauthorized Shares......Page 167 Summary......Page 168 Inventorying Printers......Page 169 Querying Multiple Computers......Page 170 Logging to a File......Page 172 Writing to a Microsoft Access Database......Page 174 Reporting on Printer Ports......Page 179 Identifying Printer Drivers......Page 185 Installing Printer Drivers Found on Your Computer......Page 187 Installing Printer Drivers Not Found on Your Computer......Page 189 Summary......Page 191 Inventorying Drives......Page 193 Writing Disk Drive Information to Microsoft Access......Page 197 Working with Partitions......Page 201 Matching Disks and Partitions......Page 203 Working with Logical Disks......Page 206 Monitoring Disk Space Utilization......Page 210 Logging Disk Space to a Database......Page 214 Monitoring File Longevity......Page 218 Monitoring Performance......Page 221 Using Performance Counter Classes......Page 222 Summary......Page 226 Reporting Networking Settings......Page 229 Working with Adapter Configuration......Page 234 Filtering Only Properties that Have a Value......Page 240 Detecting Multiple Network Adapters......Page 245 Writing Network Adapter Information to a Microsoft Excel Spreadsheet......Page 246 Identifying Connected Network Adapters......Page 250 Setting Static IP Address......Page 252 Enabling DHCP......Page 257 Configuring the Windows Firewall......Page 261 Reporting Firewall Settings......Page 262 Configuring Firewall Settings......Page 263 Summary......Page 265 Setting Screen Savers......Page 267 Auditing Screen Savers......Page 268 Listing Only Properties with Values......Page 274 Reporting Secure Screen Savers......Page 278 Managing Desktop Power Settings......Page 285 Changing the Power Scheme......Page 291 Summary......Page 297 Setting the Time......Page 299 Setting the Time Remotely......Page 300 Logging Results to the Event Log......Page 305 Configuring the Time Source......Page 311 Using the Net Time Command......Page 312 Querying the Registry for the Time Source......Page 314 Enabling User Accounts......Page 319 Creating a Local User......Page 325 Creating a Local User Group......Page 328 Configuring the Screen Saver......Page 331 Renaming the Computer......Page 338 Shutting Down or Rebooting a Remote Computer......Page 341 Summary......Page 345 Working with Backups......Page 347 Configuring Offline Files......Page 350 Enabling the Use of Offline Files......Page 353 Retrieving System Restore Settings......Page 362 Listing Available System Restore Points......Page 366 Summary......Page 369 Examining the Boot Configuration......Page 371 Examining Startup Services......Page 374 Displaying Service Dependencies......Page 377 Examining Startup Device Drivers......Page 382 Investigating Startup Processes......Page 387 Investigating Hardware Issues......Page 390 Troubleshooting Network Issues......Page 395 Summary......Page 399 Creating Organizational Units......Page 401 Creating Domain Users......Page 404 Modifying User Attributes......Page 407 Modifying General User Information......Page 408 Modifying the Address Tab......Page 409 Modifying the Profile Tab......Page 410 Modifying the Organization Tab......Page 411 Modifying a Single User Attribute......Page 412 Creating Users from a .csv File......Page 415 Enabling the User Account......Page 416 Creating Domain Groups......Page 417 Adding a User to a Domain Group......Page 420 Adding Multiple Users with Multiple Attributes......Page 422 Summary......Page 426 Examining the Clustered Server......Page 427 Reporting Cluster Configuration......Page 433 Reporting Node Configuration......Page 438 Querying Multiple Cluster Classes......Page 442 Adding and Evicting Nodes......Page 453 Removing the Cluster......Page 459 Summary......Page 464 Enabling Internet Information Services Management......Page 465 Reporting Site Information......Page 467 Reporting on Application Pools......Page 469 Reporting on Application Pool Default Values......Page 473 Reporting Site Limits......Page 476 Listing Virtual Directories......Page 479 Creating a New Web Site......Page 481 Creating a New Application Pool......Page 486 Starting and Stopping Web Sites......Page 489 Summary......Page 493 Locating Certificates in the Certificate Store......Page 495 Listing Certificates......Page 501 Locating Expired Certificates......Page 505 Identifying Certificates about to Expire......Page 510 Inspecting a Certificate......Page 514 Importing a Certificate......Page 519 Deleting a Certificate......Page 523 Summary......Page 529 Documenting Terminal Service Configuration......Page 531 Disabling Logons......Page 535 Modifying Client Properties......Page 539 Managing Users......Page 543 Enabling Users to Access the Server......Page 546 Configuring Client Settings......Page 549 Summary......Page 561 Reporting DNS Settings......Page 563 Configuring DNS Logging Settings......Page 570 Reporting Root Hints......Page 578 Querying “ A” Records......Page 579 Configuring DNS Server Settings......Page 584 Reporting DNS Zones......Page 590 Creating DNS Zones......Page 593 Managing WINS and DHCP......Page 598 Summary......Page 603 Initial Configuration......Page 605 Joining the Domain......Page 606 Setting the IP Address......Page 614 Configuring the DNS Settings......Page 619 Renaming the Server......Page 627 Monitoring the Server......Page 633 Querying Event Logs......Page 636 Summary......Page 639 Appendix A: Cmdlet Naming Conventions......Page 641 Appendix B: ActiveX Data Object Provider Names......Page 643 Appendix C: Frequently Asked Questions......Page 645 Include Functions in the Script that Calls the Function......Page 653 Use Full Cmdlet Names and Full Parameter Names......Page 654 General Script Readability......Page 655 Formatting Your Code......Page 656 Working with Functions......Page 657 Writing Functions......Page 659 Creating and Naming Variables and Constants......Page 660 Appendix E: General Troubleshooting Tips......Page 661 Index......Page 665 About the Author......Page 687 Get practical guidance for using Windows PowerShell to manage Windows Vista and Windows Server 2008. Written by Ed Wilson, a leading scripting expert and trainer at Microsoft, this reference offers a task-based approach to help you find the information you need for day-to-day tasks. With more than 200 scripts, it offers rich examples that administrators can customize for their own environment and needs. The scripts range in complexity from one-line commands, to full-blown scripts with managed output and command-line arguments—examples that are applicable to all skill levels. Includes a companion CD with fully searchable eBook, sample scripts, and other resources for managing your Windows-based environment. 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 booktech@oreilly.com. Get practical guidance for using Windows PowerShell to manage Windows Vista and Windows Server 2008. Written by Ed Wilson, a leading scripting expert and trainer at Microsoft, this reference offers a task-based approach to help you find the information you need for day-to-day tasks. With more than 200 scripts, it offers rich examples that administrators can customize for their own environment and needs. The scripts range in complexity from one-line commands, to full-blown scripts with managed output and command-line arguments examples that are applicable to all skill levels. Includes a companion CD with fully searchable eBook, sample scripts, and other resources for managing your Windows-based environment.Key Book BenefitsDelivers more than 200 scripts administrators can customize and use to get up and running quicklyProvides multiple ways of accomplishing tasks: from one-line commands to full-blown scripts with managed output and command-line argumentsFeatures a task-oriented approach, and organized to help you quickly find the information you need for your day-to-day activitiesIncludes a companion CD with a fully searchable eBook, sample scripts, and other resources for on-the-job results
دانلود کتاب Windows PowerShell(TM) Scripting Guide