WSUS automated cleanup script

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.

 
 
 
 
 
4.5 Star
(6)
3,744 times
Add to favorites
Windows Update
3/12/2018
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Connection error
    2 Posts | Last post Thu 11:19 PM
    • I also receive the same error "xception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while establishing
      " . I have found this error is only on Server 2008 and Server 2008R2 systems, the script is working wel on later server versions. Is there something to change in the script for Server 2008/2008R2 to work?
      
      Thank you
    • I am seeing the following error for each of the updates slated for deletion:
      Deleting update 250406 (134 of 4525)
      Error deleting update 250406:
      Exception calling "ExecuteNonQuery" with "0" argument(s): "@errorMessage
      spDeleteUpdate got error from spDeleteRevision"
      
      Windows Server 2016, WSUS 10.0.14393.2485 using WID
  • Error database
    2 Posts | Last post October 05, 2018
    • Hello,
      When run the script after some seconds i recieve this error >
      
      Connecting to database SUSDB on WSUS\MICROSOFT##SSEE
      Unhandled exception:
      Exception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while establishing
       a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct an
      d that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open
       a connection to SQL Server)"
    • Could you please provide more details about your setup? OS version, WSUS version, WSUS db config?