Decline WSUS Update Types

Decline several Update Types in Windows Server Update Services (WSUS). For example Beta and Preview Updates, Updates for Itanium, Drivers, Dell Hardware Drivers, Surface Hardware Drivers, SharePoint Updates in Office Channel, Language on Demand Feature updates and superseded upda

5 Star
1,261 times
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Added a section for Security Only updates
    1 Posts | Last post August 08, 2019
    • If you deploy the monthly rollups you can safely decline the security only counterparts.
      Add the following to the Param section on a new line somewhere in the middle:
      Add this whole new section in between one of the other sections of the same format:
      IF ($SecurityOnly -eq $true)
          Write-Output "Declining of Security Only updates selected, starting query."
          $SecurityOnlyUpdates = $WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined -and $_.Title -match “Security Only”}
          Write-Output "Found $($SecurityOnlyUpdates.count) Security Only Updates to decline"
            IF (! $WhatIF) {$SecurityOnlyUpdates | %{$_.Decline()}}
            $SecurityOnlyUpdates | Add-Member -MemberType NoteProperty -Name PatchType -value "SecurityOnly"
            $Updates = $Updates + $SecurityOnlyUpdates
          {"No Security Only Updates found that needed declining. Come back next 'Patch Tuesday' and you may have better luck."}  
      Thanks for this script. Hopefully this amendment enhances it for someone else.
  • "-Preview" switch isn't working
    1 Posts | Last post June 26, 2019
    • Found this script linked via this Best Practices article:
      The "-Preview" switch was delivering 0 results, fixed it with a small edit to line #123 (added a pair of parentheses):
      $BetaUpdates = $WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined  -and ($_.Title -match “preview|beta” -or (-not $_.IsDeclined -and $_.IsBeta -eq $true))}
      Hope this helps someone =O)
  • Add on declining of x86 and ARM?
    1 Posts | Last post May 28, 2019
    • Awesome little script that has proved very useful. Is there any way of declining updates for x86/32-Bit and ARM architectures too? Tried adding it myself and couldnt work out what to put for the "PatchType -value" variable