Uninstalling Windows Updates

Posted on 2008-11-13
Last Modified: 2012-05-05
I have recently deployed an WSUS server that is working well except that there is one update that is failing to install.

The update in question is the Group Policy Preference Client Side Extensions for Windows Vista (KB943729). All my computers on WSUS are reporting they do not have this installed and that they require it.

However prior to me setting up the WSUS server I had deployed this patch manually using the "wusa" command on all my computers.

I believe it is this manual install that is interfering with the WSUS install and so I am trying to uninstall this patch.

A manual uninstall works correctly however I have 500 machines to uninstall this patch on and so I am trying to script the uninstall.

I found a script to uninstall updates of the Microsoft website and have attached the script to this question

I have also attached the WindowsUpdate.log that shows the installation of the patch using the wusa command.

The output I am getting from the script is

E:\WSUS.vbs(22, 1) (null): 0x80240007

Line 22 is this line: objCollection.Add(colUpdates.Item(0))

I believe that if the patch was being found correctly then the Set colUpdates = objResults.Updates should return 1 rather than 0.

Can you please help me discover what is wrong with this patch.


Set objCollection = CreateObject("Microsoft.Update.UpdateColl")

Set objSearcher = CreateObject("Microsoft.Update.Searcher")

Set objResults = objSearcher.Search("UpdateID='764CCDDC-C9D7-4B6A-9AFA-B38EC97266BE'")

Set colUpdates = objResults.Updates

Wscript.echo colUpdates.count


Wscript.echo objCollection.count

Set objInstaller = CreateObject("Microsoft.Update.Installer")

objInstaller.Updates = objCollection

Set objInstallResults = objInstaller.Uninstall

Wscript.Echo objInstallResults.RebootRequired

Wscript.Echo objInstallResults.ResultCode

Open in new window

Question by:it-services
    LVL 52

    Expert Comment

    There has been the first update to GPCSE, maybe you installed the old one and this is the new one? The update was releases in the first two weeks of october if I remember correctly.
    Anyway, you could
    -decline this update at the wsus server if you don't expect new workstations to be added to the domain (no good, eh?)
    -install it again through wsus (it is offered again, or not?) - why not?
    LVL 1

    Author Comment

    I've tried installing it through WSUS except the install fails. If I manually uninstall the old manually installed patch then the WSUS update works.
    So what I need is a way of scripting the removal of the old update
    LVL 52

    Assisted Solution

    Look at which says that that error code 0x80240007 stands for
    A The update to be removed is not installed on the system
    B The index to a collection was invalid (whatever that means)
    LVL 1

    Author Comment

    I think that B is the error that I am getting.
    For some reason the Microsoft.Update.Searcher.Search method isn't returning any results when I specify that specific UpdateID. The UpdateID is the one that I have gotten out of the WindowsUpdate.log
    Does anyone know of a script that i can run to output all the installed patches and their corresponding UpdateID's?
    LVL 52

    Expert Comment

    It assume you will find that collection of IDs at the WSUS when you let it list all installed updates at that system.
    LVL 1

    Author Comment

    I've figured out a way to list all the UpdateID's installed and attached the code below.

    I ran this on one of the computers having the problem and I have attached the results.

    The Update that I want to remove is listed three times however when I use the specified UpdateID on my original script it still fails.

    I'm not too sure where to go from here.

    Set objSession = CreateObject("Microsoft.Update.Session")
    Set objSearcher = objSession.CreateUpdateSearcher
    intHistoryCount = objSearcher.GetTotalHistoryCount
    Set colHistory = objSearcher.QueryHistory(1, intHistoryCount)
    For Each objEntry in colHistory
        Wscript.Echo "Title: " & objEntry.Title
        WScript.Echo "UpdateID: " & objEntry.UpdateIdentity.UpdateID

    Open in new window

    LVL 1

    Accepted Solution

    I wasn't able to get this to work so I've just deployed Vista SP1 using SMS rather than WSUS and this seems to have fixed the problem with this update.

    Thanks for your help McKnife. I'm going to try to assign you some points for the assistance.


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
    This script will sweep a range of IP addresses (class c only, and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now