A new Flexera Community experience is coming on November 25th. Click here for more information.
With the use of the Software Vulnerability Manager over time, the number of packages created in Windows Server Update Services (WSUS) can begin to take up valuable disc space on the server that is facilitating the WSUS role. Simply declining and deleting packages in Software Vulnerability Manager does not remove the packages from the \UpdateServicePackages folder where Software Vulnerability Manager packages reside.
This article describes the steps necessary to review and remove old third-party packages created by Software Vulnerability Manager from your local WSUS server to reclaim disc space.
NOTE: This article is intended to help with removing packages related to Software Vulnerability Manager. If you have any questions specifically about WSUS, contact Microsoft.
If you are using System Center Updates Publisher (SCUP), you may need to run the Cleanup Wizard for SCUP.
Run WSUSutil with the parameter listunreferencedpackagefolders and delete the packages that it lists.
cd "C:\Program Files\Update Services\Tools"
WsusUtil.exe listunreferencedpackagefolders > c:\temp\deletefolders.txt
C:\temp\deletefolders.txt
The following folders are not referenced by any of the updates in your WSUS server.
rmdir /q /s
For example: rmdir /q /s C:\Sources\WSUS\UpdateServicesPackages\598ecbc7-2208-401b-9f0c-8eb57488aee
As an alternative to the above instructions, the following PowerShell commands can be used to delete all the third-party packages from your WSUS server. These commands should be executed on your WSUS server with Administrator rights.
[Reflection.Assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$wsus.GetUpdates() |
Where { $_.UpdateSource -ne "MicrosoftUpdate" } |
ForEach-Object {
$wsus.DeleteUpdate($_.Id.UpdateId.ToString())
Write-Host $_.Title removed
}
In some scenarios, you may need to follow additional steps to remove the remaining obsolete packages. If your WSUS has had an in-place reinstall with new certificates, old packages signed with the old certificates may remain in the content directory.
In this situation, you’ll need to force the deletion of all patches by going to C:\Program Files\Update Services\UpdateServicesPackages\ and deleting them.
If you need help determining which patches to delete, follow the instructions below.
on Jan 28, 2019 07:10 PM - edited on Jun 12, 2024 03:10 PM by HollyM