Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By : Thomas Lee, Ed Goad
Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By: Thomas Lee, Ed Goad

Overview of this book

This book showcases several ways that Windows administrators can use to automate and streamline their job. You'll start with the PowerShell and Windows Server fundamentals, where you'll become well versed with PowerShell and Windows Server features. In the next module, Core Windows Server 2016, you'll implement Nano Server, manage Windows updates, and implement troubleshooting and server inventories. You'll then move on to the Networking module, where you'll manage Windows network services and network shares. The last module covers Azure and DSC, where you will use Azure on PowerShell and DSC to easily maintain Windows servers.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Using troubleshooting packs


Windows includes a number of troubleshooting packs. These are tools that you can use to diagnose and resolve common errors.

Getting ready

You run this recipe on SRV1, a domain joined server in the Reskit.Org domain.

How to do it...

In this recipe, you see how to use the troubleshooting packs:

  1. Get troubleshooting packs:
$TSPackfolders = Get-ChildItem `
                       -Path C:\Windows\diagnostics\system -Directory
      $TSPacks = Foreach ($TSPack in $TSPackfolders) {
                  Get-TroubleshootingPack -Path $TSPack.FullName}
  1. Display the packs:
$TSPacks | Format-Table -Property Name, Version,
                  MinimumVersion, Description `
                              -Wrap -Autosize
  1. Get a troubleshooting pack for Windows Update:
$TsPack = $TSPacks | Where-Object `
                      id -eq 'WindowsUpdateDiagnostic'
  1. Look at the problems this troubleshooting pack addresses:
$TSPack.RootCauses
  1. Look at the solutions to these issues:
$TSPack.RootCauses.Resolutions...