Freigeben über


What to do when your WSUSContent folder grows too large

Occasionally administrators run into an issue with WSUS where their WSUSContent folder gets too large and they are at risk of running out of disk space. The only supported way to resolve these disk space issues is to use the wsusutil.exe RESET command. (see below)

I want to provide some background of how this problem may occur so the root cause can be identified. Just running the RESET process without determining how you got there may put you back where you started.

1) Do you have any WSUS downstream servers configured to download from your WSUS server? You can find out by opening up the WSUS Administrative console, and in the left pane select Downstream Servers. If there are downstream servers listed, the problem could possibly be caused by a setting in their configuration as well.

2) Update Files and Languages – Update Languages tab: You should only download updates in languages which you support. If your WSUS server has been in place for a while and all along you had All Languages defined under the Update Languages tab, and you recently changed it back to English for example, the updates which have been downloaded in other languages do not automatically get deleted or cleaned up.

Important note: If you have a downstream server configured, and All Languages is configured on the downstream server, then it will force your upstream WSUS server to download those languages regardless of the settings defined in the console.  

3) Update Files and Languages – Update Files tab: If you have “Store update files locally on this server” set, there are a couple options to be aware of.

· Download update files to this server only when updates are approved: If this is not checked then ALL updates which are synchronized are downloaded to the WSUS server. To minimize disk space requirements, this option should be checked. Note: Only use this option when you intend to approve all products and classifications that you have configured under Options – Products and Classifications.

· Download express installation files: If this is checked, then the disk space requirements for updates increase 3 to 4x the normal amount. Only use this setting if your clients are poorly connected to the WSUS server such as over a slow LAN connection or the Internet. Using express installation files requires a higher disk space investment on the server, but significantly reduces the traffic between the WSUS server and the clients.

To better explain what the difference is between Express and non-express installation files, check out this article:

https://technet.microsoft.com/cs-cz/library/cc708603.aspx in the section “Using express installation files”.

To configure WSUS to store updates locally and if you want to minimize disk space, use the below configuration.

clip_image002

If you are certain that the above settings have been configured as such on your WSUS server (including any downstream servers) since the product was installed, then it is likely that the storage requirements on your WSUS server is accurate. The only thing you may want to try is running the Server Cleanup Wizard (WSUS console – Options – Server Cleanup Wizard) because there is an option to delete any EXPIRED updates.

If you believe the settings were changed midstream causing All Languages to be downloaded at one time

Or

If you have recently changed the above settings

Or

If you find a downstream server with the incorrect settings

Or

If you decide to set old updates or non-required updates to Not Approved

… the updates in the WSUSContent folder will not automatically be cleaned up for you.

The only way to clean up your WSUSContent folder in the fewest amount of steps is to RESET the WSUS server and re-download the content for all approved updates.

How to Do a Reset:

Note: You may want to execute the procedure below during off hours as your WSUS server will be downloading quite a bit of data.

1) Correct any settings above or disapprove any unneeded updates.

2) Close any open WSUS consoles.

3) Go to Administrative Tools – Services and STOP the Update Services service.

4) In Windows Explorer browse to the WSUSContent folder (typically D:\WSUS\WSUSContent or C:\WSUS\WSUSContent)

5) Delete ALL the files and folders in the WSUSContent folder.

6) Go to Administrative Tools – Services and START the Update Services service.

7) Open a command prompt and navigate to the folder: C:\Program Files\Update Services\Tools.

8) Run the command WSUSUtil.exe RESET

-This command tells WSUS to check each update in the database, and verify that the content is present in the WSUSContent folder. As it finds that the content is not present in the folder, it executes a BITS job to download the content from Microsoft. This process takes quite a bit of time and runs in the background.

How do you tell when the process is complete?

Other than noticing that the WSUSContent folder is no longer growing you can also check the SoftwareDistribution.log:

C:\Program Files\Update Services\LogFiles\SoftwareDistribution.log

When you start the reset process, you should see a line towards the bottom of the log which looks like this:

WsusService.13 ExecutionContext.runTryCode State Machine Reset Agent Starting

After waiting for some time, check the log again and search for the text “State Machine Reset Agent Finished”

WsusService.13 ExecutionContext.runTryCode State Machine Reset Agent Finished

Comments

  • Anonymous
    January 01, 2003
    Reading your article, which actually helped me to save a great deal of disc space - thanks a lot, another possible way came to my mind which I tested on Windows 2008 R2 and WSUS3 with success:
  1. Disapprove any unneeded updates
  2. Go to "Update Files and Languages" - "Update Files" tab
  3. Select "Do not store update files locally; computer install from Microsoft Update". Be aware that WSUS actually takes a bit of time to process this change of configuration once you have clicked OK. If you reopen the "Update Files and Languages" settings it will disable the buttons "OK" and "Apply" until it is finished processing.
  4. Once it is ready, run the cleanup wizard. It will empty the WSUSContent folder.
  5. Go to "Update Files and Languages" - "Update Files" tab and select "Store update files locally on this server" again. Make sure you enable "Download update files to this server only when updates are approved".
  6. Switch to the "update Language" tab and set your preferred options.
  • Anonymous
    January 01, 2003
    Thanks for this wonderful post! I am currently facing the same problem. Are you sure the updates that are set back to "Not Approved" from "Approved" will not download again if I delete them (from WSUSContent) and run the reset? I would appreciate your comments on this. Thank you again!

  • Anonymous
    January 01, 2003
    I'm with Fiaz.  Our folder is at 39gb of 60gb total drive space.  I've got 1838 declined out of 5484 total.  I don't have any SCE experience over what my coworker who works on WSUS does, but I need the space to do AV installations.  (They share the server.) It just seems that sorting through thousands of updates to find what's needed would take an inordinate amount of time.

  • Anonymous
    January 01, 2003
    Yes, but only if you have configured WSUS to only download updates which have been approved. You can verify this in the WSUS console by selecting the Options node and clicking "Update Files and Languages". Make sure that the option: "Download update files to this server only when updates are approved" is checked. Here is a description of the WSUSUtil RESET command: "Checks that every update metadata row in the database has corresponding update files stored in the file system. If update files are missing or have been corrupted, (it) downloads the update files again." http://technet.microsoft.com/zh-cn/library/cc708604.aspx

  • Anonymous
    January 01, 2003
    Even after a RESET my WsusContent has hardly changed from 46GB. We are a small organisation and we can not afford have this folder keep growing in size. I want to follow Jonathan's procedure above and since I am novice in this area, please could you advice me how best to Decline all updates. From the Options > Automatic Approvals, do I set a new Rule up to do that and if so how and what setting etc? Or Do I need to go into each update and decline it for All Computers? I am wooried about a bit of extra work but how best to go about it. Thanks. Fiaz

  • Anonymous
    April 09, 2010
    Thank you sincerely This has helped me so much.

  • Anonymous
    November 18, 2010
    I see this deletes the actual data files, great. Should it update the database so that WSUS no longer thinks it needs 5,000 updates, and instead the computers check in with their current status, and WSUS displays to the Admin how many actual updates are needed? If so, does this just take some time?

  • Anonymous
    December 10, 2010
    Thank you very much for the advice it reduced my WSUS from 80GB to 12.5GB. But I couldn't find these lines in the log file. WsusService.13  ExecutionContext.runTryCode     State Machine Reset Agent Starting WsusService.13  ExecutionContext.runTryCode     State Machine Reset Agent Finished Thanks

  • Anonymous
    December 10, 2010
    Thank you very much for the advice it reduced my WSUS from 80GB to 12.5GB. But I couldn't find these lines in the log file. WsusService.13  ExecutionContext.runTryCode     State Machine Reset Agent Starting WsusService.13  ExecutionContext.runTryCode     State Machine Reset Agent Finished Thanks

  • Anonymous
    January 17, 2011
    A procedure that I've used with fair success is as follows:

  1. Decline all previously approved updates. (Yes, all of them. Even the ones you want.)
  2. Run the cleanup wizard -- this will remove files in the WsusContent folder.
  3. Change the approval of all DECLINED updates from declined to "Not Approved" (and apply inheritance).
  4. Run the cleanup wizard again -- this will decline all expired updates.
  5. Re-approve needed updates. Content will be redownloaded. Note that in very large installations, this may result in a LOT of work.
  • Anonymous
    August 26, 2013
    The problem is that it will redownload all approved updates, including approved updates that are no longer needed (that is, have been applied) by any computer on the network -- and there will be thousands of them. Before doing this, you need to change all previously approved updates to "not approved." Afterwards, go back and reapprove those that are still needed.

  • Anonymous
    January 30, 2014
    excelent

  • Anonymous
    February 04, 2014
    Thanks Clemens E - it was the approval of a large number of non-applicable updates that was taking up so much room on the server.