Configuring WSUS automatic approvals

Microsoft's Windows Update can produce a large number of updates for you to manage (inspect, accept/decline, and deploy). Some update types, or example critical updates, may be ones you want to automatically approve, so as soon as you receive one of these, you can start deploying it.

Getting ready

This recipe assumes you have a WSUS server, WSUS1, set up as per the previous recipes in this chapter. You can also use your own WSUS server, adapting this recipe as appropriate.

How to do it...

  1. Create the auto-approval rule:
    $WSUSServer   = Get-WsusServer
    $ApprovalRule = 
      $WSUSServer.CreateInstallApprovalRule('Critical Updates')
  2. Define a deadline for the rule:
    $Type = 'Microsoft.UpdateServices.Administration.' + 'AutomaticUpdateApprovalDeadline' ...

Get Windows Server 2019 Automation with PowerShell Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.