|
| 1 | +#requires -version 5.1 |
| 2 | + |
1 | 3 | <# |
2 | 4 | .SYNOPSIS |
3 | | -Decline several Update Types in Windows Server Update Services (WSUS) |
4 | | -
|
| 5 | + Decline several Update Types in Windows Server Update Services (WSUS) |
| 6 | + |
5 | 7 | .DESCRIPTION |
6 | | -Decline several Update Types in Windows Server Update Services (WSUS). For example Beta and Preview Updates, Updates for Itanium, Drivers, Dell Hardware, Surface Hardware, SharePoint Updates in Office Channel, |
7 | | -Language on Demand Feature updates and superseded updates. The scrips send, if configured a list of the decliened updates. |
| 8 | + Decline several Update Types in Windows Server Update Services (WSUS). For example Beta and Preview Updates, Updates for Itanium, Drivers, Dell Hardware, Surface Hardware, SharePoint Updates in Office Channel, |
| 9 | + Language on Demand Feature updates and superseded updates. The scrips send, if configured a list of the decliened updates. |
8 | 10 |
|
9 | 11 | .EXAMPLE |
10 | | -decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -Superseded -SmtpServer "Mail.domai.tld" -EmailLog |
| 12 | + decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -Superseded -SmtpServer "Mail.domai.tld" -EmailLog |
11 | 13 |
|
12 | 14 | .EXAMPLE |
13 | | -decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -SharePoint |
| 15 | + decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -SharePoint |
14 | 16 |
|
15 | 17 | .PARAMETER Preview |
16 | | -Decline Updates with the phrases -Preview- or -Beta- in the title or the attribute -beta- set |
| 18 | + Decline Updates with the phrases -Preview- or -Beta- in the title or the attribute -beta- set |
17 | 19 |
|
18 | 20 | .PARAMETER Itanium |
19 | | -Decline Updates with the phrases -ia64- or -itanium- |
| 21 | + Decline Updates with the phrases -ia64- or -itanium- |
20 | 22 |
|
21 | 23 | .PARAMETER LanguageFeatureOnDemand |
22 | | -Decline Updates with the phrases -LanguageFeatureOnDemand- or -Lang Pack (Language Feature) Feature On Demand- or -LanguageInterfacePack- |
| 24 | + Decline Updates with the phrases -LanguageFeatureOnDemand- or -Lang Pack (Language Feature) Feature On Demand- or -LanguageInterfacePack- |
23 | 25 |
|
24 | 26 | .PARAMETER Sharepoint |
25 | | -Decline Updates with the phrases -SharePoint Enterprise Server- or -SharePoint Foundation- or -SharePoint Server- or -FAST Search Server- Some of these are part of the Office Update Channel |
| 27 | + Decline Updates with the phrases -SharePoint Enterprise Server- or -SharePoint Foundation- or -SharePoint Server- or -FAST Search Server- Some of these are part of the Office Update Channel |
26 | 28 |
|
27 | 29 | .PARAMETER Dell |
28 | | -Decline Updates with the phrases -Dell- for reducing for example the updates in the drivers category, if no Dell Hardware is used |
| 30 | + Decline Updates with the phrases -Dell- for reducing for example the updates in the drivers category, if no Dell Hardware is used |
29 | 31 |
|
30 | 32 | .PARAMETER Surface |
31 | | -Decline Updates with the phrases -Surface- and -Microsoft- |
| 33 | + Decline Updates with the phrases -Surface- and -Microsoft- |
32 | 34 |
|
33 | 35 | .PARAMETER Drivers |
34 | | -Decline Updates with the Classification -Drivers- |
| 36 | + Decline Updates with the Classification -Drivers- |
35 | 37 |
|
36 | 38 | .PARAMETER OfficeWebApp |
37 | | -Decline Updates with the phrases -Excel Web App- or -Office Web App- or -Word Web App- or -PowerPoint Web App- |
| 39 | + Decline Updates with the phrases -Excel Web App- or -Office Web App- or -Word Web App- or -PowerPoint Web App- |
38 | 40 |
|
39 | 41 | .PARAMETER Officex86 |
40 | | -Decline Updates with the phrases -32-Bit- and one of these -Microsoft Office-, -Microsoft Access-, -Microsoft Excel-, -Microsoft Outlook-, -Microsoft Onenote-, -Microsoft PowerPoint-, -Microsoft Publisher-, -Microsoft Word- |
| 42 | + Decline Updates with the phrases -32-Bit- and one of these -Microsoft Office-, -Microsoft Access-, -Microsoft Excel-, -Microsoft Outlook-, -Microsoft Onenote-, -Microsoft PowerPoint-, -Microsoft Publisher-, -Microsoft Word- |
41 | 43 |
|
42 | 44 | .PARAMETER Officex64 |
43 | | -Decline Updates with the phrases -64-Bit- and one of these -Microsoft Office-, -Microsoft Access-, -Microsoft Excel-, -Microsoft Outlook-, -Microsoft Onenote-, -Microsoft PowerPoint-, -Microsoft Publisher-, -Microsoft Word- |
| 45 | + Decline Updates with the phrases -64-Bit- and one of these -Microsoft Office-, -Microsoft Access-, -Microsoft Excel-, -Microsoft Outlook-, -Microsoft Onenote-, -Microsoft PowerPoint-, -Microsoft Publisher-, -Microsoft Word- |
44 | 46 |
|
45 | 47 | .PARAMETER Superseded |
46 | | -Decline Updates with the attribute -IsSuperseded- |
| 48 | + Decline Updates with the attribute -IsSuperseded- |
47 | 49 |
|
48 | 50 | .NOTES |
49 | | -Author : Fabian Niesen |
50 | | -Filename : decline-WSUSUpdatesTypes.ps1 |
51 | | -Requires : PowerShell Version 3.0 |
52 | | - |
53 | | -Version : 1.7 |
54 | | -History : 1.7 Add "Dev" to filter for -Preview (#3), Replace powershell alias with full commands |
55 | | - 1.6 Add WSUS internal Cleanup Trigger |
56 | | - 1.5 Add ARM64, LTSB2015, LTSB2016, LTSC2019 to script |
57 | | - 1.4 Add Config file |
58 | | - 1.3 Coments, Header added |
59 | | - 1.2 Fix issues |
60 | | - 1.1 added Mail funtion |
61 | | - 1.0 initial version |
62 | | - |
| 51 | + Author : Fabian Niesen |
| 52 | + Filename : decline-WSUSUpdatesTypes.ps1 |
| 53 | + Requires : PowerShell Version 5.1 |
| 54 | + License : The MIT License (MIT) |
| 55 | + Copyright (c) 2022-2025 Fabian Niesen |
| 56 | + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation |
| 57 | + files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, |
| 58 | + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
| 59 | + furnished to do so, subject to the following conditions: |
| 60 | + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| 61 | + The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties |
| 62 | + of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be |
| 63 | + liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in |
| 64 | + connection with the software or the use or other dealings in the Software. |
| 65 | + Disclaimer : This script is provided "as is" without warranty. Use at your own risk. |
| 66 | + The author assumes no responsibility for any damage or data loss caused by this script. |
| 67 | + Test thoroughly in a controlled environment before deploying to production. |
| 68 | + Version : 1.8 |
| 69 | + History : 1.8 FN 03.12.2025 change to MIT License, housekeeping Header, add Edge Beta / Dev channel to Preview filter |
| 70 | + 1.7 Add "Dev" to filter for -Preview (#3), Replace powershell alias with full commands |
| 71 | + 1.6 Add WSUS internal Cleanup Trigger |
| 72 | + 1.5 Add ARM64, LTSB2015, LTSB2016, LTSC2019 to script |
| 73 | + 1.4 Add Config file |
| 74 | + 1.3 Coments, Header added |
| 75 | + 1.2 Fix issues |
| 76 | + 1.1 added Mail funtion |
| 77 | + 1.0 initial version |
| 78 | +
|
63 | 79 | .LINK |
64 | | -https://www.infrastrukturhelden.de/microsoft-infrastruktur/wsus/windows-server-update-services-bereinigen.html |
| 80 | + https://www.infrastrukturhelden.de/microsoft-infrastruktur/wsus/windows-server-update-services-bereinigen.html |
65 | 81 | #> |
| 82 | + |
66 | 83 | [cmdletbinding()] |
67 | 84 | Param( |
68 | 85 | [Parameter(Position=1)] |
@@ -133,7 +150,8 @@ Param( |
133 | 150 | [switch]$load |
134 | 151 | ) |
135 | 152 |
|
136 | | - |
| 153 | +$scriptversion = "1.8" |
| 154 | +Write-Output "Starting decline-WSUSUpdatesTypes.ps1 version $scriptversion" |
137 | 155 | $conffile = "./decline-WSUSUpdatesType.clixml" |
138 | 156 |
|
139 | 157 | IF ($save) |
@@ -183,7 +201,7 @@ IF ($WhatIF) { Write-Warning "WhatIF Mode, no changes will be made!!!"} |
183 | 201 | IF ($Preview -eq $true) |
184 | 202 | { |
185 | 203 | Write-Output "Declining of Beta and Preview updates selected, starting query." |
186 | | - $BetaUpdates = $WsusServerAdminProxy.GetUpdates() | Where-Object{-not $_.IsDeclined -and ($_.Title -match "preview|beta|dev" -or -not $_.IsDeclined -and $_.IsBeta -eq $true)} |
| 204 | + $BetaUpdates = $WsusServerAdminProxy.GetUpdates() | Where-Object{-not $_.IsDeclined -and ($_.Title -match "preview|edge-beta|edge-dev|beta channel|prerelease" -or $_.IsBeta -eq $true)} |
187 | 205 | Write-Output "Found $($BetaUpdates.count) Preview or Beta Updates to decline" |
188 | 206 | If($BetaUpdates) |
189 | 207 | { |
|
0 commit comments