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

Managing updates


The WSUS administrator performs several tasks to manage update distribution. These tasks begin with the awareness of which updates are available, approved, installed or marked to be installed for each computer target group. For the available updates, the administrator must approve or reject the updates to control which updates are made available. This recipe covers listing installed updates, listing available updates, approving updates, and declining updates.

Getting ready

In this recipe, you manage updates using PowerShell. You should open a PowerShell session on WSUS1 to perform this recipe.

How to do it...

In this recipe you manage WSUS updates:

  1. Open a PowerShell session, and view the overall status of all Windows updates on WSUS1:
      $WSUSServer = Get-WsusServer      $WSUSServer.GetStatus()
  1. View the computer targets:
$WSUSServer.GetComputerTargets()
  1. View the installed updates on DC1 using Get-Hotfix and Get-SilWindowsUpdate:
Get-HotFix -ComputerName DC1$CimSession = New-CimSession...