Announcement

Collapse
No announcement yet.

Bloated WSUS Wreaking Havoc

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bloated WSUS Wreaking Havoc

    SBS 2011

    Our server has not been properly maintained in regards to wsus and now has about 35,000 obsolete updates that I need to delete. I found a script to do that but each update seems to be taking about an hour. I don't have four years to wait for this thing to finish. I've stopped the wsus service. Is there anything else I can do to speed this up or should I get ready to go nuclear and uninstall and reinstall wsus? This is the script I'm using:

    Code:
    USE SUSDB
    DECLARE @var1 INT, @curitem INT, @totaltodelete INT
    DECLARE @msg nvarchar(200)
    CREATETABLE #results4(Col1 INT)INSERTINTO #results4(Col1)
    EXEC spGetObsoleteUpdatesToCleanup
    SET @totaltodelete =(SELECTCOUNT(*)FROM #results4)
    SELECT @curitem=1
    DECLARE WC CursorFORSELECT Col1 FROM #results4
    OPEN WC
    FETCHNEXTFROM WC INTO @var1 WHILE (@@FETCH_STATUS>-1)
    BEGINSET @msg =cast(@curitem asvarchar(5))+'/'+cast(@totaltodelete asvarchar(5))+': Deleting '+CONVERT(varchar(10), @var1)+' '+cast(getdate()asvarchar(30))
    RAISERROR(@msg,0,1)WITHNOWAIT
    EXEC spDeleteUpdate@localUpdateID=@var1
    SET @curitem = @curitem +1
    FETCHNEXTFROM WC INTO @var1
    END
    CLOSE WC
    DEALLOCATE WC
    DROPTABLE #results4

  • #2
    Have you tried using the WSUS console to do this?

    Comment


    • #3
      Also re-index your WSUS database using the script here:
      http://gallery.technet.microsoft.com/ScriptCenter/6f8cde49-5c52-4abd-9820-f1d270ddea61/
      Tom Jones
      MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
      PhD, MSc, FIAP, MIITT
      IT Trainer / Consultant
      Ossian Ltd
      Scotland

      ** Remember to give credit where credit is due and leave reputation points where appropriate **

      Comment


      • #4
        Originally posted by joeqwerty View Post
        Have you tried using the WSUS console to do this?
        Thanks for the replies. I forgot to mention that I have been trying the console repeatedly but I'm not getting anywhere, it keeps timing out and I've verified that it isn't actually deleting anything.

        Ossian, I'm running the re-index now and hoping for the best. Thank you.

        Comment


        • #5
          It took a while but I finally got the reindexing to run successfully. Unfortunately, I still can't get the WSUS cleanup wizard to run and it is still taking forever to delete updates via the sql script mentioned above. Any other options?

          Comment


          • #6
            Nope. You could always blow it away and start again.

            Comment

            Working...
            X