How to Clear Out Your WSUSContent Folder

13

Today I had an interesting issue where a particular server’s WSUSContent folder increased in size incredibly quickly to the point where the logical disk it was hosted on ran out of space. This server was running Windows Server 2003.

There is a handy utility, WSUSUtil.exe, which allows IT administrators to reset the WSUS components and rechecks each update in the database, verifying the content is present in the WSUSContent folder and downloads it again if necessary from Microsoft.

Although this allows you to set a clean slate for WSUS, there must be a reason why your WSUSContent folder increased in size so quickly in the first place. It’s important to find this out before doing any reset, or else you will be needlessly re-downloading the exact same data again.

What to Check

Update Files & Languages – This should be the first port of call. Ensure you are downloading only the updates your network needs. If you had a setting selected before but turned it off at a later date (such as ‘All Languages’ instead of just ‘English’), they will still be present in the WSUSContent folder – there is no automatic deletion process.

WSUS Downstream Servers – Ensure that the downstream servers are configured correctly – remember settings set here can also affect what your upstream WSUS server downloads, even if the settings between the servers are different.

Download Files Only When Updates are Approved – In an ideal world, IT admins should always test updates before rolling out onto client computers. If this option in WSUS is not checked, then all updates that are synced are downloaded. Of course you then need to approve any applicable updates after setting this.

Even with the correct settings applied, WSUS can have many GBs of data stored. The Server Cleanup Wizard can help as it does offer to delete any ‘expired’ updates, but it doesn’t perform all the magic that’s required.

I Found My Issue – How Do You Do a Reset?

  1. Correct any settings above or disapprove any unneeded updates.
  2. Close any open WSUS consoles on that server for all sessions currently logged on.
  3. Go to Administrative Tools – Services (or run ‘services.msc’) and STOP the Update Services service.WSUSUtil.exe
  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 (or run ‘services.msc’) 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’

As you are downloading a lot of updates again, it can take a few hours for the process to fully complete – be patient!

How do you tell when the process is complete?

You can check by ensuring the WSUSContent folder is not growing, or you can check the SoftwareDistribution.log, which is located:

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

When you start the reset command, you should see a line towards the bottom of the log similar to this:

WSUS ResetStateMachineAgentWsusService.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

 

I hope this has helped you! Any questions, just drop a comment below.

 

Share.

About Author

Luke is a Citrix & Microsoft IT consultant based in the UK. His Citrix qualifications include CCE-V, CCP-N and CCP-M. He also holds an MCSA in Windows Server 2012 and is a certified MCITP on Windows Server 2008. He loves cats but hates spiders and the cold.

13 Comments

  1. Igor Levicki on

    I had a situation where WSUS was failing to download updates after moving content from one local drive to another. I thought resetting might fix it but it didn’t. The problem was that wsusutil movecontent didn’t change paths and shares so it was still using the old location. The way to fix that is to run wsusutil postinstall CONTENT_DIR= after performing reset.

  2. Hi Luke,
    Just a big question for you. I can read that you have a lot of knowledge of WSUS and I would need your help quite urgent.

    Please can you just quickly let me know what exactly would it happen with the SQL or another database that I have installed in the Server 2008 SP1 R2 if I delete and remove completely the Service of WSUS from the Server.

    I need to do the above as it is taking almost all of space of the C:\ in one of the companies server that I am taking over.

    I would appreciate any help that you can give me.

    Best regards
    Ruben Garcia

  3. Luke,

    One question, I have one primary/upstream WSUS Server and approximately 7 downstream servers configured as replica’s. Do you know performing the above to remove all old server/XP updates on the primary server will cause the downstream servers to remove any unused content, or will I need to wipe all downstream servers using the same method?

    And thank you for a clear post on wiping and starting fresh with WSUS.

  4. Hi Luke,
    I need your assistance. wrt Wsus.
    Wsus sync to Microsoft just fails. An Http error occurred. and Event Viewer error 10022 & 10032.
    I can access internet from the server. Tried with and without proxy.
    This is all after having issues on WSUS and reinstalling. Initial sync and a few thereafter worked 100%. and suddenly I get above errors.
    Wsus clients are reporting to wsus fine.
    Your time and assistance will be greatly appreciated.

  5. Found this site looking for a solution to my bloated \wsus\WsusContent folder. My server is limping along towards retirement in the next few months. WSUS was running on it at one time, but was shut off, leaving the WsusContent folder content as its huge self. I don’t ever plan to re-activate it nor apply any updates – just trying to keep the server from running out of disk space, which is a struggle. Can I safely delete the contents of WsusContent without harm in my scenario? Thanks

  6. My understanding is that it is not running. I know that the setting was changed so that updates are not automatically downloaded some months ago and the newest files in the \wsus\WsusContent folder are 10 months ago. Is there a setting or a service that I need to check to make sure it is not running before I delete the folder? Thanks.

  7. Hi Luke,

    I have a question related to downloading all the files again “As you are downloading a lot of updates again, it can take a few hours for the process to fully complete – be patient!”.

    Can we schedule this download in an off peak time or this can be set work on the synchronization schedule time of the WUSU setting.

    Thanks !

    Xavier

  8. I tried the suggested steps several times. I waited two weeks for the WsusContent folder to be re-filled, but no joy. I have re-booted, and started over. I followed the instructions to the letter, but no joy.
    Can anyone think of something additional I might try, or check?

Leave a Reply...