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

Configuring the Windows Update client


Windows computers download updates from Microsoft servers by default. To override this behavior, you can either configure the Windows Update client using GPO settings or manually update the registry of each client.

Getting ready

Run this recipe from WSUS1 with RSAT installed for working with Group Policy Objects.

$FeatureName = 'RSAT'
Install-WindowsFeature $FeatureName -IncludeAllSubFeature

How to do it...

The steps for the recipe are as follows:

  1. Define and view the WSUS server URL using the properties returned from Get-WsusServer:
      $WSUSServer = Get-WsusServer
      $WSUSServerURL = "http{2}://{0}:{1}" -f `
                      $WSUSServer.Name, 
                      $WSUSServer.PortNumber,
                      ('','s')[$WSUSServer.UseSecureConnection]
      $WSUSServerURL
  1. Create a Group Policy Object (GPO) and link it to your domain:
$PolicyName = "WSUS Client"
       New-GPO -Name $PolicyName
       New-GPLink -Name $PolicyName -Target "DC=RESKIT...