The Server Cleanup Wizard is a part of the WSUS UI that you can use to manage your disk space. This wizard can do tasks such as removing unused updates, deleting unused computers, deleting unneeded updates, and much more to clean up a WSUS partition. This guide covers how to resolve and prevent the “Connection Error” you see when you start the wizard.

After you start the WSUS Cleanup Wizard, the following error message displays:

WSUS Connection Error

WSUS Connection Error

The error occurs because the partition doesn´t have enough disk space to write the log file that the Cleanup Wizard generates. If you can extend the disk space, you can run the wizard without this error.

Extend the disk space using Disk Management ^

  1. Open the Computer Management console by opening Run and typing msc.
  2. Click Disk Manager and right-click the volume that hosts the WSUS partition.
  3. Click Extend Volume.
  4. Follow the instructions on the server.

Move the WSUS partition to another partition ^

Open the command prompt and type the following commands:

Cd C:\Program Files\Update Services\Tools
wsusutil.exe movecontent W:\WSUS\ W:\WSUSMove.log

The last command will move the WSUS files to W: and create a log file with the name WSUSMove.log.

After a while, the content should be moved and your log file should look like this:

WSUS Move Log

WSUS Move Log

If you can´t extend the disk space or move the content, you can remove WSUSContent files, run the Cleanup Wizard, and then fetch the WSUSContent with the database.

  1. Stop the Update service by running the following command:
     net stop wuauserv
  2. Browse to the path WSUSDrive:\WSUS\WsusContent and remove enough updates for the wizard to be able to create a log file on the WSUS partition. In my case, the log file was about 2 GB.
  3. Start the Update service by running the following command:
     net start wuauserv
  4. Open the WSUS administration console, select Options, and then select Server Cleanup Wizard. Select all check boxes and then click Next.
  5. When the cleanup has finished, run the following commands:
    Cd C:\Program Files\Update Services\Tools
    exe reset

The command wsusutil.exe reset tells WSUS to check each update in the database and verify that the content is present in the WSUSContent folder. If some updates aren´t located in the WSUSContent folder, WSUS will execute a BITS job to download the missing updates.

How do you know when the job is finished? You can verify this by checking the log file named SoftwareDistribution.log. It is located in C:\Program Files\Update Services\LogFiles.

If you open the log file using Notepad, you can search for Reset Agent Finished. You should find something like the following to indicate that the task has finished:

WsusService.14  ExecutionContext.runTryCode     State Machine Reset Agent Finished

Software Distribution Log

Software Distribution Log

How can you prevent the connection error? ^

You should extend the disk space of the WSUS partition as soon as possible. You should also create a scheduled task that cleans up your WSUSDrive. Here is how to do this:

  1. Save the following script to C:\admin\Scripts\WSUS\WSUSCleanup.ps1 on your server:
    # WSUSCleanup.ps1
     | out-null 
    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); 
    $cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope; 
    $cleanupScope.DeclineSupersededUpdates = $true        
    $cleanupScope.DeclineExpiredUpdates         = $true 
    $cleanupScope.CleanupObsoleteUpdates     = $true 
    $cleanupScope.CompressUpdates                  = $true 
    $cleanupScope.CleanupObsoleteComputers = $true 
    $cleanupScope.CleanupUnneededContentFiles = $true 
    $cleanupManager = $wsus.GetCleanupManager(); 
    # Script END
  1. Open the Task Scheduler on your server.
  2. Right-click Task Scheduler Library and select Create Basic Task.
    Task Scheduler 1
  3. Define a Name and Description and click Next.
    Task Scheduler 2
  4. Set the Trigger
    Task Scheduler 3
  5. In the Action section, select Start a Program and enter the following options:
    Program/script: powershell
    Add arguments (optional): -file "C:\admin\Scripts\WSUS\WSUSCleanup.ps1"Task Scheduler 4
  1. In the Finish section, select Open the Properties dialog for this task when I click Finish and then click Finish.
    Task Scheduler 5
  2. To run whether user is logged on or not, select that option on the General Then, click OK and supply your credentials.
    Task Scheduler 6


  1. Roger Chapman 6 years ago

    I tried the powershell script, but after 5 minutes I saw the task did not complete successfully.

    Last run result (0xFFFD0000)

    WSUS is on it’s own drive with 250 GB of space.  173GB is free.

    I have not been able to approve updates since April.  Have tried lots of other fixes, none work.


    Any advice?

  2. Sanket Patel 5 years ago
  3. Super IT guy 4 years ago

    Sorry, this is wrong. Low disk space *may* generate this error, but it is not the root cause.  My volumes have triple digit GB free.  Also, Sanket, your answer is wrong too, my App Pool memory setting is already unlimited.

    Guys, when you publish information, make sure it is correct.

Leave a reply

Your email address will not be published.


© 4sysops 2006 - 2022


Please ask IT administration questions in the forums. Any other messages are welcome.


Log in with your credentials


Forgot your details?

Create Account