Link to home
Start Free TrialLog in
Avatar of it-services
it-services

asked on

Uninstalling Windows Updates

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

0
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.

Mat

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
 
objCollection.Add(colUpdates.Item(0))
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

WindowsUpdate.log
Avatar of McKnife
McKnife
Flag of Germany image

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?
Avatar of it-services
it-services

ASKER

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
 
Mat
SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
 
Mat
It assume you will find that collection of IDs at the WSUS when you let it list all installed updates at that system.
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
    Wscript.Echo
Next

Open in new window

WSUS.txt
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial