Skip to content

Commit 3bb4ecc

Browse files
committed
Change License, extent Preview switch to include more Beta software
1 parent 3ec24cf commit 3bb4ecc

1 file changed

Lines changed: 52 additions & 34 deletions

File tree

WSUS/decline-WSUSUpdatesTypes.ps1

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,85 @@
1+
#requires -version 5.1
2+
13
<#
24
.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+
57
.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.
810
911
.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
1113
1214
.EXAMPLE
13-
decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -SharePoint
15+
decline-WSUSUpdatesTypes.ps1 -Preview -Itanium -SharePoint
1416
1517
.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
1719
1820
.PARAMETER Itanium
19-
Decline Updates with the phrases -ia64- or -itanium-
21+
Decline Updates with the phrases -ia64- or -itanium-
2022
2123
.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-
2325
2426
.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
2628
2729
.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
2931
3032
.PARAMETER Surface
31-
Decline Updates with the phrases -Surface- and -Microsoft-
33+
Decline Updates with the phrases -Surface- and -Microsoft-
3234
3335
.PARAMETER Drivers
34-
Decline Updates with the Classification -Drivers-
36+
Decline Updates with the Classification -Drivers-
3537
3638
.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-
3840
3941
.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-
4143
4244
.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-
4446
4547
.PARAMETER Superseded
46-
Decline Updates with the attribute -IsSuperseded-
48+
Decline Updates with the attribute -IsSuperseded-
4749
4850
.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+
6379
.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
6581
#>
82+
6683
[cmdletbinding()]
6784
Param(
6885
[Parameter(Position=1)]
@@ -133,7 +150,8 @@ Param(
133150
[switch]$load
134151
)
135152

136-
153+
$scriptversion = "1.8"
154+
Write-Output "Starting decline-WSUSUpdatesTypes.ps1 version $scriptversion"
137155
$conffile = "./decline-WSUSUpdatesType.clixml"
138156

139157
IF ($save)
@@ -183,7 +201,7 @@ IF ($WhatIF) { Write-Warning "WhatIF Mode, no changes will be made!!!"}
183201
IF ($Preview -eq $true)
184202
{
185203
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)}
187205
Write-Output "Found $($BetaUpdates.count) Preview or Beta Updates to decline"
188206
If($BetaUpdates)
189207
{

0 commit comments

Comments
 (0)