WSUS Unnecessary Content Cleanup

PAVZ 136 Reputation points

Dear Team

I want to clear WSUS unnecessarycontent by script:

  • Connect to WSUS database
  • Decline expired updates
  • Decline superseded updates
  • Delete obsolete updates (updates are deleted one by one to avoid timeouts)
  • Delete unneeded content files

My WSUS Service in Windows Server 2012 R2 with WSUS 4.

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

1 answer

Sort by: Most helpful
  1. Amandayou-MSFT 11,021 Reputation points

    Hi @MarufHossain-3174,

    We could use this script in this article:

    And the script runs WSUS cleanup tasks using stored procedures in WSUS database directly, avoiding timeout errors and WSUS service crash that may occur when using WSUS' Cleanup Wizard.

    If the response is helpful, please click "Accept Answer" and upvote it.
    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.