3

Performing WSUS cleanup which hasn't been done for quite a while - running the cleanup-wizard with the only selected option being "unneeded update files":

enter image description here

After about three minutes of processing, the wizard crashed due to a timeout-exception: enter image description here

This is the message I press "copy to clipboard" in the console:

The WSUS administration console was unable to connect to the WSUS Server via the remote API. 

Verify that the Update Services service, IIS and SQL are running on the server. If the problem persists, try restarting IIS, SQL, and the Update Services Service.

System.Net.WebException -- The operation has timed out

Source System.Windows.Forms

Stack Trace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at Microsoft.UpdateServices.UI.SnapIn.Wizards.ServerCleanup.ServerCleanupWizard.OnCleanupComplete(Object sender, PerformCleanupCompletedEventArgs e)

...tried the same thing in an elevated instance of PowerShell: enter image description here


What I have tried so far:

  • Since the timeout period appears to be ~3mins I have set the connection timeout of the Wsus-Site in IIS from 180sec to 10800sec: enter image description here

  • made sure the Account associated with the IIS-ApplicationPool has sufficient permissions on the WSUSContent folder

  • made sure the account I'm running the wizward/script is a member in the WSUS administrators group (and administrators group of the server)

  • disabled the query timeout on the SQL-Server my SUSDB is running on (originally did this while cleaning unused updates and update revisions)

All other WSUS cleanup steps are working - initially I had a few hiccups while cleaning "unused updates and update revisions" as the cleanup hadn't been performed for a long time. However, after manually deleting a few updates from the database and disabling the timeout that step completed without errors. I should also mention the WSUS server is part of an SCCM-environment and it's managed by our SUP (cleanup on scheduled update sync is enabled).

Looking around the forums I've found several helpful threads dealing with timeouts while cleaning up "unused updates and update files", but I have not found much about the same problem while cleaning "unneeded update files". So any help would be appreciated here.

slagjoeyoco
  • 253
  • 1
  • 4
  • 13

1 Answers1

1

This script is old, but I've had good luck running it on my WSUS server. I inherited one that was completely out of control and the console would crash at various places. I also run this reindex WSUS database script as well, which might help.

I've been running these as nightly maintenance ever since.

Katherine Villyard
  • 18,510
  • 4
  • 36
  • 59
  • thank you for this script - I ran it yesterday and discovered today that it actually ran through, including phase 2 (unneeded update files only). What struck me as strange is that it listet 0 disk space freed. So I tried to run it again just out of curiosity and now it keeps failing with the same timeout-exception during phase 2. – slagjoeyoco Nov 10 '17 at 10:13
  • Thanks so much. Our problem was the default timeout of 180. Increased it to 10800 as well and now no errors and the cleanup can complete. – rejohnson Mar 02 '20 at 18:10
  • Attention! This link contains a Virus detected by Sophos! **This script is old**, ,,,, – Ronald Hirth May 23 '21 at 07:19
  • And now both scripts are dead links. This is why things should be included on the page and not just linked to. – duct_tape_coder Aug 16 '21 at 21:13