WSUS clear declined updates

PeterRaban 221 Reputation points
2022-10-19T06:26:51.677+00:00

I have lots of declined updates in my WSUS, I tried to run server cleanup wizard to clear it but failed.
Will wsus clear declined updates automatically? How to clear the declined updates manually?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,275 questions
0 comments No comments
{count} votes

Accepted answer
  1. AllenLiu-MSFT 45,686 Reputation points Microsoft Vendor
    2022-10-19T07:08:06.79+00:00

    Hi, @PeterRaban

    Thank you for posting in Microsoft Q&A forum.

    In my experience, WSUS will not clear the declined updates automatically, I always use below script to delete the declined updates:

     [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")  
    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();  
    $declined=$wsus.GetUpdates() | Where {$_.IsDeclined -eq $true}  
    $declined| ForEach-Object {$wsus.DeleteUpdate($_.Id.UpdateId.ToString()); Write-Host $_.Title removed }  
    

    Here is the example in my WSUS:
    251873-1.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.