Windows Server Update Services (WSUS)

Last modified by Sebastian Marsching on 2022/05/30 12:44

For more information on WSUS, also see Windows Server 2012 R2.

Removing superseded updates

With new updates being released regularly, more and more superseded updated accumulate over time. The files for those superseded updates consume a considerable amount of disk space after some time.

Superseded updates that have been approved for installation can be found by selecting approved updates in the "All Updates" view, adding the "Supersedence" column and then sorting for this column.

There are two ways to remove the files for those updates:

The first option is to decline them and then run the "Server Cleanup Wizard" (which can be found in the "Options" area). This method is described here. This method has the disadvantage that updates that might be needed in the future may be accidentally declined because the supersedence status is not 100% reliable (an update might only be superseded by another update for certain system configurations). One comment in the linked article suggests declining the updates, then running the cleanup wizard, and finally setting them back to "not approved".

The second option it to mark the updates as "Not Approved". However, this will not delete the associated files and there is no direct option to delete those files either. The only way is to remove all files in the WsusContent folder and then again downloading the files that are still needed. The WSUS service should be stopped before deleting the files and restarted after. After that, the WsusUtil.exe (which can be found in C:\Program Files\Update Services\Tools) should be run with the reset command. This will start the background process that downloads the needed files. This method is described here.

Regarding WSUS maintenance, there is another blog entry in the TechNet blog that describes maintenance tasks that should periodically be run on a WSUS server (e.g. re-indexing the database). It also provides some hints regarding what to do if the Server Cleanup Wizard keeps timing out.

In addition to the hints in that article, I found another trick: For me, the Server Cleanup Wizard was timing out when running the "Decline expired updates" action. I could fix this by running the spDeclineExpiredUpdates procedure from SQL Studio. I used "WUS Server" for the adminName parameter of this procedure. After that I ran the wizard again, and regenerated the indices. After doing this a few times, the wizard would finally complete without timing out. As always, make a backup of the SUSDB database before trying any of this.

My idea to run spDeclineExpiredUpdates was based on the ideas given in this thread.

Optimizing IIS pool settings

  • Queue length: 2000 (default 1000,  WAM recommends 25000)
  • Idle time-out (minutes): 0 (default 20)
  • Ping enabled: False (default True)
  • Private memory limit (KB): 0 (unlimited,  default 4294967)
  • Regular Time Interval (minutes): 0 (default 1740)

(see https://docs.microsoft.com/en-us/troubleshoot/mem/configmgr/windows-server-update-services-best-practices)

IIS site settings for TLS

Configure TLS certificate for port 8531.  After that,  run

"%programfiles%\Update Services\Tools\WsusUtil.exe" configuressl <FQDN>

Require SSL (SSL Settings => Require SSL) for the following endpoints:

  • ApiRemoting30
  • ClientWebService
  • DssAuthWebService
  • ServerSyncWebService
  • SimpleAuthWebService

(see https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh852346(v=ws.11)?redirectedfrom=MSDN#35-secure-wsus-with-the-secure-sockets-layer-protocol and https://www.ajtek.ca/wsus/how-to-setup-manage-and-maintain-wsus-part-7-ssl-setup-for-wsus-and-why-you-should-care/)

Enabling compression

Enable dynamic compression by running

cscript "%programfiles%\update services\setup\DynamicCompression.vbs" /enable "%programfiles%\Update Services\WebServices\suscomp.dll"

Importing updates into WSUS

$wsus = Get-WsusServer
$wsus.ImportUpdateFromCatalogSite('<Update ID>', '<Full path to update file>')

(see https://www.windowspro.de/wolfgang-sommergut/updates-manuell-wsus-importieren-ie-powershell (in German))

Strong cryptography for the .NET Framework has to be enabled in order for this to work, but even then I somehow couldn’t make this method work, so I resorted to opening the Microsoft Update Catalog in Internet Explorer and directly importing the updates from there (that method worked for me).

Selecting the products to be synchronized

Obviously, this strongly depends on which software is used in the environment, so this list applies to me, but for other environments you will probably have to adapt it.

WSUS products that should be synchronized:

  • “Developer Tools, Runtimes, and Redistributables” (incl. sub-products, for .NET framework and VS runtime updates not included in the Windows product)
  • “Microsoft Defender Antivirus” (if you are not using a third-party anti-virus software on all syste,s)
  • “Microsoft Server operating system-21H2” (for Windows Server 2022 updates)
  • “Windows 10, version 1903 and later” (for Windows 10 updates)

Additional WSUS products that might be useful:

  • “Microsoft SQL Server Management Studio v18”
  • “Windows Server, version 1903 and later” (it contains the Malicious Software Removal Tool for Windows Server 2022, which is not included in the “Microsoft Server operating system-21H2” product, but the same removal tool is included in the “Windows 10, version 1903 and later” product, so including one of the two is sufficient)
  • “Windows Dictionary Updates” (though it seems there are not any recent updates in this product)
  • “Windows Server Manager - Windows Server Update Services (WSUS) Dynamic Installer” (it does not contain any recent updates, so it is a bit unclear whether this product is still used to distribute updates for WSUS, but it does not contain a lot of updates either, so synchronizing it probably won’t hurt)
  • “Windows Admin Center”
  • “Windows Subsystem for Linux”

Driver products:
(in general, it is a bad idea to synchronize those, unless you are using WSUS Automated Maintenance, which will delete all the driver updates that are synced initially, that only new drivers will appear)

  • “Windows - Client, version 21H2 and later, Servicing Drivers”
  • “Windows - Client, version 21H2 and later, Upgrade & Servicing Drivers”
  • “Windows - Server, version 21H2 and later, Servicing Drivers”
  • “Windows - Server, version 21H2 and later, Upgrade & Servicing Drivers”
  • “Windows 10, version 1903 and later, Servicing Drivers”
  • “Windows 10, version 1903 and later, Upgrade & Servicing Drivers”

Products that are most likely not needed:

  • “PowerShell - x64” (only needed when using PowerShell Core, not for Windows PowerShell, and we can get PowerShell Core as MSI packages as well, so distributing updates this way probably makes more sense)
  • “Microsoft Edge” (seems like this is not needed and Edge is going to be kept up-to-date even if we do not synchronize this product)
  • “Dynamic Updates” (and GDR-DU, they are only intended for inclusion in installation images)
  • “Windows 10 Feature On Demand” (only contains old stuff, that we probably don’t need anyway)
  • “Windows 10 Language Interface Packs” and “Windows 10 Language Packs” (only contain language packs for old versions of Windows 10)
  • “Windows 10” (updates for older versions of Windows 10)
  • “Windows Media Dynamic Installer” (only very old updates)
  • “Windows Ultimate Extras” (only very old updates)

Windows Defender Anti-Virus updates and WSUS

By default, Windows Defender will load definition updates from Windows Update if WSUS is not available (https://admx.help/?Category=Windows_7_2008R2&Policy=Microsoft.Policies.WindowsDefender::CheckAlternateDownloadLocation).

For computers where automatic installation of updates is not enabled (servers), we can use the Update-MpSignature PS cmdlet in a scheduled task in order to install definition updates (https://docs.microsoft.com/en-us/powershell/module/defender/update-mpsignature?view=windowsserver2022-ps).

More information on Defender updates: https://www.microsoft.com/en-us/wdsi/defenderupdates

Resources