locked
simulating the server cleanup wizard from the command line RRS feed

  • Question

  • We have several servers that run WSUS 3.0 SP2.   Are there command line equivalents (wsusutil, etc.) that perform the same tasks as the server cleanup wizard?  The objective is to set up a scheduled task so that the server cleanup wizard does not have to be run manually.

    Thanks in advance,
    Sergio
    • Edited by Sergio Martin Wednesday, December 2, 2009 4:05 PM typo
    Wednesday, December 2, 2009 4:04 PM

Answers

  • Hi Sergio,

    By default, there is no command line to run server cleanup wizard.

    But you can run this wizard by writing a command-line tool (VB, WSUS SDK)that calls WSUS API.

    Windows Server Update Services API Samples and Tools

    http://download.microsoft.com/download/8/d/0/8d068114-bd66-4fde-a04c-aeaa9d1fe640/Update%20Services%20API%20Samples%20and%20Tools.EXE

    Also, I found an article which provide a solution to run server cleanup wizard via powershell:

    Perform WSUS 3.0 Cleanup Manager via Powershell

    http://pulsarit.net/cs/blogs/claudiog/archive/2007/05/16/eseguire-wsus-3-0-cleanup-manager-via-powershell.aspx

    • Marked as answer by Eric Zhang CHN Monday, December 21, 2009 5:56 AM
    Thursday, December 3, 2009 9:30 AM

All replies

  • Hi Sergio,

    By default, there is no command line to run server cleanup wizard.

    But you can run this wizard by writing a command-line tool (VB, WSUS SDK)that calls WSUS API.

    Windows Server Update Services API Samples and Tools

    http://download.microsoft.com/download/8/d/0/8d068114-bd66-4fde-a04c-aeaa9d1fe640/Update%20Services%20API%20Samples%20and%20Tools.EXE

    Also, I found an article which provide a solution to run server cleanup wizard via powershell:

    Perform WSUS 3.0 Cleanup Manager via Powershell

    http://pulsarit.net/cs/blogs/claudiog/archive/2007/05/16/eseguire-wsus-3-0-cleanup-manager-via-powershell.aspx

    • Marked as answer by Eric Zhang CHN Monday, December 21, 2009 5:56 AM
    Thursday, December 3, 2009 9:30 AM
  • Just to add some links, it appears that the Powershell script link provided above is not functioning this morning.  Searching around, I did find a technet blog on Automating WSUS Cleanup that refers folks who might not want to run a powershell script over to a codeplex project that is a WSUS cleanup tool.
    Friday, August 16, 2013 2:25 PM
  • The Scripting Guys have written a quick little script for this:

    http://gallery.technet.microsoft.com/scriptcenter/fd39c7d4-05bb-4c2d-8a99-f92ca8d08218


    - John Straffin, Duke University OIT

    • Proposed as answer by Straffin Wednesday, January 22, 2014 10:00 PM
    Wednesday, January 22, 2014 10:00 PM