Question

WSUS doesnt update Servers, but does update clients

Asked by: BolAcc

Hello,
I've got a strange problem with WSUS. In our organisation we use WSUS to update clients, this works fine. But the servers wont update. They all say that they are up-to-date in the client console, but if i look on the windowsupdate.com page there are 25 updates.

Only the servers are giving these errors, and wont update. The clients are working fine.

Logging:

2009-04-22 16:16:53:804 832 1afc PT WARNING: GetCookie failure, error = 0x8024400D, soap client error = 7, soap error code = 300, HTTP status code = 200
2009-04-22 16:16:53:804 832 1afc PT WARNING: SOAP Fault: 0x00012c
2009-04-22 16:16:53:804 832 1afc PT WARNING: faultstring:System.Web.Services.Protocols.SoapException: Fault occurred
at Microsoft.UpdateServices.Internal.SoapUtilities.ThrowException(ErrorCode errorCode, String message, String[] clientIds)
at Microsoft.UpdateServices.Internal.Authorization.AuthorizationManager.GetCookie(AuthorizationCookie[] authCookies, Cookie oldCookie, DateTime lastChange, DateTime currentClientTime, String clientProtocolVersion)
at Microsoft.UpdateServices.Internal.ClientImplementation.GetCookie(AuthorizationCookie[] authCookies, Cookie oldCookie, DateTime lastChange, DateTime currentClientTime, String protocolVersion)
at Microsoft.UpdateServices.Internal.Client.GetCookie(AuthorizationCookie[] authCookies, Cookie oldCookie, DateTime lastChange, DateTime currentTime, String protocolVersion)
2009-04-22 16:16:53:804 832 1afc PT WARNING: ErrorCode:ServerChanged(4)
2009-04-22 16:16:53:804 832 1afc PT WARNING: Message:Server rolled back since last call to GetCookie
2009-04-22 16:16:53:804 832 1afc PT WARNING: Method:"http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookie"
2009-04-22 16:16:53:804 832 1afc PT WARNING: ID:b568f71f-b45b-4ea2-924e-5434f3aa392a
2009-04-22 16:16:53:804 832 1afc PT WARNING: PTError: 0x80244015
2009-04-22 16:16:53:804 832 1afc PT WARNING: GetCookie_WithRecovery failed : 0x80244015
2009-04-22 16:16:53:804 832 1afc PT WARNING: RefreshCookie failed: 0x80244015
2009-04-22 16:16:53:804 832 1afc PT WARNING: RefreshPTState failed: 0x80244015
2009-04-22 16:16:53:804 832 1afc PT WARNING: Sync of Updates: 0x80244015
2009-04-22 16:16:53:913 832 1afc PT WARNING: Cached cookie has expired or new PID is available.
                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-04-23 at 04:37:39ID24348488
Tags

WSUS

,

servers

,

doesnt

,

update

Topic

Server Applications

Participating Experts
1
Points
450
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. WSUS
    Can someone point me to tips where the WSUS server is not seeing new computers on the network?
  2. WSUS 3.0 - clients wont appear in console
    Here is the configuration. (i am currently testing WSUS 3.0 in a lab before deploying across the network). I have a master WSUS 3.0 server running Server 2003 SP1. Named: WSUS1 I have a server configured as a WSUS Replica server running Server 2003 SP1. Named. OFFICE1. I hav...
  3. WSUS
    i have set up a Domain Controller (DC) in a separate network that is secured with a firewall. The WSUS server which i set up is in my company network. I have deployed the WSUS policy to the DC, and have confirmed the DC is getting the policy by doing a GPUPDATE /FORCE and GPR...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: dstewartjrPosted on 2009-04-23 at 08:38:39ID: 24216369

If you are using more than one wsus server read here

http://blogs.technet.com/sus/archive/2008/10/29/wsus-clients-fail-synchronization-with-0x80244015-and-0x8024400d-errors.aspx

if you are using a proxy run from command prompt proxycfg -u

 

by: dstewartjrPosted on 2009-04-23 at 08:40:05ID: 24216392

Also there's a hotfix that pertains to this issue

http://support.microsoft.com/?id=898708

 

by: BolAccPosted on 2009-04-23 at 23:36:41ID: 24222256

I dont use more than one WSUS server, and i have the server running on a Windows server 2003 Standard Edtion SP2. So the patch is integrated in the Service Pack. And i dont use a proxy either.

 

by: dstewartjrPosted on 2009-04-24 at 06:49:33ID: 24225093

Save below as fixwsus.cmd and run on clients that are giving you trouble.

%Windir%\system32\net.exe stop bits 
%Windir%\system32\net.exe stop wuauserv
 
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v AccountDomainSid /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v PingID /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientValidation /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v LastWaitTimeout /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v DetectionStartTime /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v NextDetectionTime /f
 
 
 
 
if exist %Windir%\system32\atl.dll %Windir%\system32\regsvr32.exe /s %Windir%\system32\atl.dll  
if exist %Windir%\system32\jscript.dll %Windir%\system32\regsvr32.exe /s %Windir%\system32\jscript.dll 
if exist %Windir%\system32\softpub.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\softpub.dll  
if exist %Windir%\system32\wuapi.dll %Windir%\system32\regsvr32.exe /s %Windir%\system32\wuapi.dll 
if exist %Windir%\system32\wuaueng.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wuaueng.dll  
if exist %Windir%\system32\wuaueng1.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wuaueng1.dll  
if exist %Windir%\system32\wucltui.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wucltui.dll  
if exist %Windir%\system32\wups.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wups.dll  
if exist %Windir%\system32\wups2.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wups2.dll  
if exist %Windir%\system32\wuweb.dll  %Windir%\system32\regsvr32.exe /s %Windir%\system32\wuweb.dll  
if exist %windir%\system32\iuengine.dll %windir%\system32\regsvr32.exe /s iuengine.dll
if exist %windir%\system32\wuauserv.dll %windir%\system32\regsvr32.exe /s wuauserv.dll
if exist %windir%\system32\cdm.dll %windir%\system32\regsvr32.exe /s cdm.dll
if exist %windir%\system32\msxml2r.dll %windir%\system32\regsvr32.exe /s msxml2r.dll
if exist %windir%\system32\msxml3r.dll %windir%\system32\regsvr32.exe /s msxml3r.dll
if exist %windir%\system32\msxml.dll  %windir%\system32\regsvr32.exe /s msxml.dll
if exist %windir%\system32\msxml3.dll %windir%\system32\regsvr32.exe /s msxml3.dll
if exist %windir%\system32\msxmlr.dll %windir%\system32\regsvr32.exe /s msxmlr.dll
if exist %windir%\system32\msxml2.dll %windir%\system32\regsvr32.exe /s msxml2.dll
if exist %windir%\system32\qmgr.dll %windir%\system32\regsvr32.exe /s qmgr.dll
if exist %windir%\system32\qmgrprxy.dll %windir%\system32\regsvr32.exe /s qmgrprxy.dll
if exist %windir%\system32\iuctl.dll %windir%\system32\regsvr32.exe /s iuctl.dll
 
del C:\Windows\WindowsUpdate.log /S /Q
rd /s /q %windir%\softwareDistribution
sleep 5
%Windir%\system32\net.exe start bits 
%Windir%\system32\net.exe start wuauserv 
 
 
sc sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
 
 
sc sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
 
wuauclt.exe /resetauthorization
wuauclt.exe /detectnow 
wuauclt.exe /reportnow
 
 
 
exit /B 0 

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:

Select allOpen in new window

 

by: BolAccPosted on 2009-04-24 at 07:13:16ID: 24225408

It is still not working. But the server reports immediately to the WSUS server, but it still gives 100%. And i got a new error:

2009-04-24	16:12:12:109	 852	1230	AU	<<## SUBMITTED ## AU: Search for updates [CallId = {9424A7B8-B48A-43F4-ACA7-AE21E3E93426}]
2009-04-24	16:12:12:109	 852	133c	PT	WARNING: GetConfig_WithRecovery failed: 0x8024000b
2009-04-24	16:12:12:109	 852	133c	PT	WARNING: RefreshConfig failed: 0x8024000b
2009-04-24	16:12:12:109	 852	133c	PT	WARNING: RefreshPTState failed: 0x8024000b
2009-04-24	16:12:12:109	 852	133c	PT	WARNING: PTError: 0x8024000b
2009-04-24	16:12:12:109	 852	133c	Report	WARNING: Reporter failed to upload events with hr = 8024000b.

                                              
1:
2:
3:
4:
5:
6:

Select allOpen in new window

 

by: BolAccPosted on 2009-04-24 at 07:16:50ID: 24225441

Complete new logging:

2009-04-24	16:15:37:241	 832	c0c	Misc	===========  Logging initialized (build: 7.2.6001.788, tz: +0200)  ===========
2009-04-24	16:15:37:241	 832	c0c	Misc	  = Process: C:\WINDOWS\System32\svchost.exe
2009-04-24	16:15:37:241	 832	c0c	Misc	  = Module: C:\WINDOWS\system32\wuaueng.dll
2009-04-24	16:15:37:241	 832	c0c	Service	*************
2009-04-24	16:15:37:241	 832	c0c	Service	** START **  Service: Service startup
2009-04-24	16:15:37:241	 832	c0c	Service	*********
2009-04-24	16:15:37:257	 832	c0c	Agent	  * WU client version 7.2.6001.788
2009-04-24	16:15:37:257	 832	c0c	Agent	  * Base directory: C:\WINDOWS\SoftwareDistribution
2009-04-24	16:15:37:257	 832	c0c	Agent	  * Access type: No proxy
2009-04-24	16:15:37:257	 832	c0c	Agent	  * Network state: Connected
2009-04-24	16:15:39:366	 832	1cfc	Agent	***********  Agent: Initializing Windows Update Agent  ***********
2009-04-24	16:15:39:366	 832	1cfc	Agent	***********  Agent: Initializing global settings cache  ***********
2009-04-24	16:15:39:366	 832	1cfc	Agent	  * WSUS server: http://BOL-APP:8530
2009-04-24	16:15:39:366	 832	1cfc	Agent	  * WSUS status server: http://BOL-APP:8530
2009-04-24	16:15:39:366	 832	1cfc	Agent	  * Target group: Productie Servers
2009-04-24	16:15:39:366	 832	1cfc	Agent	  * Windows Update access disabled: No
2009-04-24	16:15:39:679	 832	c0c	Agent	Created new random SusClientId ea9ac684-21fa-4c6c-a864-b90e512af55d. Old Id: none.
2009-04-24	16:15:39:679	 832	c0c	Report	***********  Report: Initializing static reporting data  ***********
2009-04-24	16:15:39:679	 832	c0c	Report	  * OS Version = 5.2.3790.2.0.196880
2009-04-24	16:15:39:788	 832	c0c	Report	  * Computer Brand = HP
2009-04-24	16:15:39:788	 832	c0c	Report	  * Computer Model = ProLiant DL380 G3
2009-04-24	16:15:39:804	 832	c0c	Report	  * Bios Revision = P29
2009-04-24	16:15:39:804	 832	c0c	Report	  * Bios Name = Default System BIOS
2009-04-24	16:15:39:804	 832	c0c	Report	  * Bios Release Date = 2004-09-15T00:00:00
2009-04-24	16:15:39:804	 832	c0c	Report	  * Locale ID = 1043
2009-04-24	16:15:43:100	 832	1cfc	DtaStor	Default service for AU is {00000000-0000-0000-0000-000000000000}
2009-04-24	16:15:43:538	 832	1cfc	DtaStor	Default service for AU is {9482F4B4-E343-43B6-B170-9A65BC822C77}
2009-04-24	16:15:43:538	 832	1cfc	Agent	WARNING: Failed to read the service id for re-registration 0x80070002
2009-04-24	16:15:43:538	 832	1cfc	Agent	WARNING: Missing service entry in the backup data store; cleaning up
2009-04-24	16:15:43:538	 832	1cfc	DnldMgr	Download manager restoring 0 downloads
2009-04-24	16:15:43:757	 832	1c44	AU	###########  AU: Initializing Automatic Updates  ###########
2009-04-24	16:15:43:757	 832	1c44	AU	AU setting next detection timeout to 2009-04-24 14:15:43
2009-04-24	16:15:43:757	 832	1c44	AU	  # WSUS server: http://BOL-APP:8530
2009-04-24	16:15:43:757	 832	1c44	AU	  # Detection frequency: 5
2009-04-24	16:15:43:757	 832	1c44	AU	  # Target group: Productie Servers
2009-04-24	16:15:43:757	 832	1c44	AU	  # Approval type: Scheduled (Policy)
2009-04-24	16:15:43:757	 832	1c44	AU	  # Scheduled install day/time: Every day at 22:00
2009-04-24	16:15:43:757	 832	1c44	AU	  # Auto-install minor updates: No (Policy)
2009-04-24	16:15:43:757	 832	1c44	AU	  # Will interact with non-admins (Non-admins are elevated)
2009-04-24	16:15:43:757	 832	1c44	AU	Setting AU scheduled install time to 2009-04-24 20:00:00
2009-04-24	16:15:43:757	 832	1c44	AU	AU finished delayed initialization
2009-04-24	16:15:43:757	 832	1c44	AU	Triggering AU detection through DetectNow API
2009-04-24	16:15:43:757	 832	1c44	AU	Triggering Online detection (non-interactive)
2009-04-24	16:15:43:757	 832	c0c	AU	#############
2009-04-24	16:15:43:757	 832	c0c	AU	## START ##  AU: Search for updates
2009-04-24	16:15:43:757	 832	c0c	AU	#########
2009-04-24	16:15:43:772	 832	c0c	AU	<<## SUBMITTED ## AU: Search for updates [CallId = {7708BC7E-6C1F-4D30-891C-A94F7872C9D7}]
2009-04-24	16:15:43:772	 832	1810	Agent	*************
2009-04-24	16:15:43:772	 832	1810	Agent	** START **  Agent: Finding updates [CallerId = AutomaticUpdates]
2009-04-24	16:15:43:772	 832	1810	Agent	*********
2009-04-24	16:15:43:772	 832	1810	Agent	  * Online = Yes; Ignore download priority = No
2009-04-24	16:15:43:772	 832	1810	Agent	  * Criteria = "IsHidden=0 and IsInstalled=0 and DeploymentAction='Installation' and IsAssigned=1 or IsHidden=0 and IsPresent=1 and DeploymentAction='Uninstallation' and IsAssigned=1 or IsHidden=0 and IsInstalled=1 and DeploymentAction='Installation' and IsAssigned=1 and RebootRequired=1 or IsHidden=0 and IsInstalled=0 and DeploymentAction='Uninstallation' and IsAssigned=1 and RebootRequired=1"
2009-04-24	16:15:43:772	 832	1810	Agent	  * ServiceID = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}
2009-04-24	16:15:43:772	 832	1810	Agent	  * Search Scope = {Machine}
2009-04-24	16:15:46:288	 832	1810	Misc	Validating signature for C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wuident.cab:
2009-04-24	16:15:46:288	 832	1810	Misc	 Microsoft signed: Yes
2009-04-24	16:15:46:319	 832	1810	Misc	Validating signature for C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wsus3setup.cab:
2009-04-24	16:15:46:335	 832	1810	Misc	 Microsoft signed: Yes
2009-04-24	16:15:46:335	 832	1810	Setup	***********  Setup: Checking whether self-update is required  ***********
2009-04-24	16:15:46:335	 832	1810	Setup	  * Inf file: C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wsus3setup.inf
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\cdm.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuapi.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuapi.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuauclt.exe: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuaucpl.cpl: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuaucpl.cpl.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuaueng.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuaueng.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wucltui.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wucltui.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wups.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wups2.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	Update NOT required for C:\WINDOWS\system32\wuweb.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-24	16:15:46:350	 832	1810	Setup	WARNING: Warning: Setup callback ReportProgress failed: 0x8007000d
2009-04-24	16:15:46:350	 832	1810	Setup	  * IsUpdateRequired = No
2009-04-24	16:15:46:616	 832	1810	PT	+++++++++++  PT: Synchronizing server updates  +++++++++++
2009-04-24	16:15:46:616	 832	1810	PT	  + ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}, Server URL = http://BOL-APP:8530/ClientWebService/client.asmx
2009-04-24	16:15:46:741	 832	1810	PT	WARNING: Cached cookie has expired or new PID is available
2009-04-24	16:15:46:741	 832	1810	PT	Initializing simple targeting cookie, clientId = ea9ac684-21fa-4c6c-a864-b90e512af55d, target group = Productie Servers, DNS name = bol-app.bolacc.nl
2009-04-24	16:15:46:741	 832	1810	PT	  Server URL = http://BOL-APP:8530/SimpleAuthWebService/SimpleAuth.asmx
2009-04-24	16:15:51:397	 832	1810	PT	+++++++++++  PT: Synchronizing extended update info  +++++++++++
2009-04-24	16:15:51:397	 832	1810	PT	  + ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}, Server URL = http://BOL-APP:8530/ClientWebService/client.asmx
2009-04-24	16:15:51:616	 832	1810	Agent	  * Found 0 updates and 45 categories in search; evaluated appl. rules of 223 out of 488 deployed entities
2009-04-24	16:15:51:616	 832	1810	Agent	*********
2009-04-24	16:15:51:616	 832	1810	Agent	**  END  **  Agent: Finding updates [CallerId = AutomaticUpdates]
2009-04-24	16:15:51:616	 832	1810	Agent	*************
2009-04-24	16:15:51:616	 832	1810	Report	REPORT EVENT: {88897E22-2C42-4D22-9C85-F0A70F4BF720}	2009-04-24 16:15:51:616+0200	1	147	101	{00000000-0000-0000-0000-000000000000}	0	0	AutomaticUpdates	Success	Software Synchronization	Windows Update Client successfully detected 0 updates.
2009-04-24	16:15:51:616	 832	1e34	AU	>>##  RESUMED  ## AU: Search for updates [CallId = {7708BC7E-6C1F-4D30-891C-A94F7872C9D7}]
2009-04-24	16:15:51:616	 832	1e34	AU	  # 0 updates detected
2009-04-24	16:15:51:616	 832	1810	Report	REPORT EVENT: {37BDFAF5-4D18-45A1-ACDE-15A0CA10B9D3}	2009-04-24 16:15:51:616+0200	1	156	101	{00000000-0000-0000-0000-000000000000}	0	0	AutomaticUpdates	Success	Pre-Deployment Check	Reporting client status.
2009-04-24	16:15:51:616	 832	1e34	AU	#########
2009-04-24	16:15:51:616	 832	1e34	AU	##  END  ##  AU: Search for updates [CallId = {7708BC7E-6C1F-4D30-891C-A94F7872C9D7}]
2009-04-24	16:15:51:616	 832	1e34	AU	#############
2009-04-24	16:15:51:632	 832	1e34	AU	AU setting next detection timeout to 2009-04-24 18:33:14
2009-04-24	16:15:51:632	 832	1e34	AU	Setting AU scheduled install time to 2009-04-24 20:00:00
2009-04-24	16:15:51:741	 832	1810	Report	Uploading 2 events using cached cookie, reporting URL = http://BOL-APP:8530/ReportingWebService/ReportingWebService.asmx
2009-04-24	16:15:51:757	 832	1810	Report	Reporter successfully uploaded 2 events.
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:

Select allOpen in new window

 

by: dstewartjrPosted on 2009-04-24 at 07:24:54ID: 24225568

 

by: dstewartjrPosted on 2009-04-24 at 07:27:47ID: 24225613

Another thing, you might be seeing that there are available updates on microsoft and differently in the console based on your approvals.

 

by: BolAccPosted on 2009-04-24 at 07:30:54ID: 24225653

Jup i tried the microsoft solution, still doesnt work. The clientdiag gives no errors:

WSUS Client Diagnostics Tool

Checking Machine State
        Checking for admin rights to run tool . . . . . . . . . PASS
        Automatic Updates Service is running. . . . . . . . . . PASS
        Background Intelligent Transfer Service is running. . . PASS
        Wuaueng.dll version 7.2.6001.788. . . . . . . . . . . . PASS
                This version is WSUS 2.0

Checking AU Settings
        AU Option is 4: Scheduled Install . . . . . . . . . . . PASS
                Option is from Policy settings

Checking Proxy Configuration
        Checking for winhttp local machine Proxy settings . . . PASS
                Winhttp local machine access type
                        <Direct Connection>
                Winhttp local machine Proxy. . . . . . . . . .  NONE
                Winhttp local machine ProxyBypass. . . . . . .  NONE
        Checking User IE Proxy settings . . . . . . . . . . . . PASS
                User IE Proxy. . . . . . . . . . . . . . . . .  NONE
                User IE ProxyByPass. . . . . . . . . . . . . .  NONE
                User IE AutoConfig URL Proxy . . . . . . . . .  NONE
                User IE AutoDetect
                AutoDetect not in use

Checking Connection to WSUS/SUS Server
                WUServer = http://BOL-APP:8530
                WUStatusServer = http://BOL-APP:8530
        UseWuServer is enabled. . . . . . . . . . . . . . . . . PASS
        Connection to server. . . . . . . . . . . . . . . . . . PASS
        SelfUpdate folder is present. . . . . . . . . . . . . . PASS

Press Enter to Complete

 

by: dstewartjrPosted on 2009-04-24 at 07:39:12ID: 24225770


"Found 0 updates and 45 categories in search"

 

It looks like that either the updates arent approved or that wsus hasnt downloaded them

 

by: BolAccPosted on 2009-04-24 at 07:57:10ID: 24225972

They are approved, but how can i check if WSUS downloaded the updates?
Cant it be a permission setting or something like that, its a bit odd that the clients work, and the servers dont.

 

by: dstewartjrPosted on 2009-04-24 at 08:47:28ID: 24226398

I believe you can check in synchronizations

in case he updates may not have downloaded

Download the wsusdebugtool and run the following command

http://download.microsoft.com/download/7/7/4/7745a34e-f563-443b-b4f8-3a289e995255/WSUS%20Server%20Debug%20Tool.EXE

 

wsusdebugtool /tool:setforegrounddownload

 

 

by: dstewartjrPosted on 2009-04-24 at 08:50:28ID: 24226422

Better yet, lets Purge / Delete corrupted or Un-needed patches on WSUS Server

http://msmvps.com/blogs/athif/archive/2005/10/27/Purge-Delete-the-downloaded-patches-on-WSUS-Server.aspx

 

and then you can re-download them as mentioned in the link above by using wsusutil.exe reset

 

by: BolAccPosted on 2009-04-27 at 00:26:23ID: 24239459

Ok. i tried the wsusdebugtool, nothing happend.

Also i tried wsusutil.exe reset, still no solution. the servers still give errors and are 100%

 

by: BolAccPosted on 2009-04-28 at 03:27:08ID: 24249199

A little update.

I reinstalled the WSUS on a new clean server, everything looks fine. Cliets update good, but the servers dont :( still giving 100%. If i look at windowsupdate.com the server has 23 security updates. I'm sure i approved the updates and if i look in the windowsupdate.log i dont see any errors?

The log:

2009-04-28	12:11:24:070	 852	534	Misc	===========  Logging initialized (build: 7.2.6001.788, tz: +0200)  ===========
2009-04-28	12:11:24:070	 852	534	Misc	  = Process: C:\WINDOWS\System32\svchost.exe
2009-04-28	12:11:24:070	 852	534	Misc	  = Module: C:\WINDOWS\system32\wuaueng.dll
2009-04-28	12:11:24:070	 852	534	Service	*************
2009-04-28	12:11:24:070	 852	534	Service	** START **  Service: Service startup
2009-04-28	12:11:24:070	 852	534	Service	*********
2009-04-28	12:11:24:086	 852	534	Agent	  * WU client version 7.2.6001.788
2009-04-28	12:11:24:086	 852	534	Agent	  * Base directory: C:\WINDOWS\SoftwareDistribution
2009-04-28	12:11:24:086	 852	534	Agent	  * Access type: No proxy
2009-04-28	12:11:24:101	 852	534	Agent	  * Network state: Connected
2009-04-28	12:11:26:164	 852	8e0	Agent	***********  Agent: Initializing Windows Update Agent  ***********
2009-04-28	12:11:26:179	 852	8e0	Agent	***********  Agent: Initializing global settings cache  ***********
2009-04-28	12:11:26:179	 852	8e0	Agent	  * WSUS server: http://BOL-APP2:80
2009-04-28	12:11:26:179	 852	8e0	Agent	  * WSUS status server: http://BOL-APP2:80
2009-04-28	12:11:26:179	 852	8e0	Agent	  * Target group: Productie Servers
2009-04-28	12:11:26:179	 852	8e0	Agent	  * Windows Update access disabled: No
2009-04-28	12:11:26:320	 852	534	Agent	Created new random SusClientId 97251052-2513-46bd-94a1-6cfaa1002681. Old Id: none.
2009-04-28	12:11:26:320	 852	534	Report	***********  Report: Initializing static reporting data  ***********
2009-04-28	12:11:26:320	 852	534	Report	  * OS Version = 5.2.3790.2.0.131344
2009-04-28	12:11:26:398	 852	534	Report	  * Computer Brand = HP
2009-04-28	12:11:26:398	 852	534	Report	  * Computer Model = ProLiant DL360 G4
2009-04-28	12:11:26:414	 852	534	Report	  * Bios Revision = P52
2009-04-28	12:11:26:414	 852	534	Report	  * Bios Name = Default System BIOS
2009-04-28	12:11:26:414	 852	534	Report	  * Bios Release Date = 2005-08-16T00:00:00
2009-04-28	12:11:26:414	 852	534	Report	  * Locale ID = 1033
2009-04-28	12:11:29:461	 852	8e0	DtaStor	Default service for AU is {00000000-0000-0000-0000-000000000000}
2009-04-28	12:11:29:867	 852	8e0	DtaStor	Default service for AU is {9482F4B4-E343-43B6-B170-9A65BC822C77}
2009-04-28	12:11:29:867	 852	8e0	Agent	WARNING: Failed to read the service id for re-registration 0x80070002
2009-04-28	12:11:29:867	 852	8e0	Agent	WARNING: Missing service entry in the backup data store; cleaning up
2009-04-28	12:11:29:867	 852	8e0	DnldMgr	Download manager restoring 0 downloads
2009-04-28	12:11:30:054	 852	3a8	AU	###########  AU: Initializing Automatic Updates  ###########
2009-04-28	12:11:30:070	 852	3a8	AU	AU setting next detection timeout to 2009-04-28 10:11:30
2009-04-28	12:11:30:070	 852	3a8	AU	  # WSUS server: http://BOL-APP2:80
2009-04-28	12:11:30:070	 852	3a8	AU	  # Detection frequency: 5
2009-04-28	12:11:30:070	 852	3a8	AU	  # Target group: Productie Servers
2009-04-28	12:11:30:070	 852	3a8	AU	  # Approval type: Scheduled (Policy)
2009-04-28	12:11:30:070	 852	3a8	AU	  # Scheduled install day/time: Every day at 22:00
2009-04-28	12:11:30:070	 852	3a8	AU	  # Auto-install minor updates: No (Policy)
2009-04-28	12:11:30:070	 852	3a8	AU	  # Will interact with non-admins (Non-admins are elevated)
2009-04-28	12:11:30:070	 852	3a8	AU	Setting AU scheduled install time to 2009-04-28 20:00:00
2009-04-28	12:11:30:070	 852	3a8	AU	AU finished delayed initialization
2009-04-28	12:11:30:070	 852	534	AU	#############
2009-04-28	12:11:30:070	 852	534	AU	## START ##  AU: Search for updates
2009-04-28	12:11:30:070	 852	534	AU	#########
2009-04-28	12:11:30:070	 852	534	AU	<<## SUBMITTED ## AU: Search for updates [CallId = {BACECC32-0203-42FA-A92A-2A50D39FDF64}]
2009-04-28	12:11:30:070	 852	c80	Agent	*************
2009-04-28	12:11:30:070	 852	c80	Agent	** START **  Agent: Finding updates [CallerId = AutomaticUpdates]
2009-04-28	12:11:30:070	 852	c80	Agent	*********
2009-04-28	12:11:30:070	 852	c80	Agent	  * Online = Yes; Ignore download priority = No
2009-04-28	12:11:30:070	 852	3a8	AU	Triggering AU detection through DetectNow API
2009-04-28	12:11:30:070	 852	c80	Agent	  * Criteria = "IsHidden=0 and IsInstalled=0 and DeploymentAction='Installation' and IsAssigned=1 or IsHidden=0 and IsPresent=1 and DeploymentAction='Uninstallation' and IsAssigned=1 or IsHidden=0 and IsInstalled=1 and DeploymentAction='Installation' and IsAssigned=1 and RebootRequired=1 or IsHidden=0 and IsInstalled=0 and DeploymentAction='Uninstallation' and IsAssigned=1 and RebootRequired=1"
2009-04-28	12:11:30:070	 852	3a8	AU	Piggybacking on an AU detection already in progress
2009-04-28	12:11:30:070	 852	c80	Agent	  * ServiceID = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}
2009-04-28	12:11:30:070	 852	c80	Agent	  * Search Scope = {Machine}
2009-04-28	12:11:32:382	 852	c80	Misc	Validating signature for C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wuident.cab:
2009-04-28	12:11:32:445	 852	c80	Misc	 Microsoft signed: Yes
2009-04-28	12:11:32:476	 852	c80	Misc	Validating signature for C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wsus3setup.cab:
2009-04-28	12:11:32:492	 852	c80	Misc	 Microsoft signed: Yes
2009-04-28	12:11:32:492	 852	c80	Setup	***********  Setup: Checking whether self-update is required  ***********
2009-04-28	12:11:32:492	 852	c80	Setup	  * Inf file: C:\WINDOWS\SoftwareDistribution\SelfUpdate\Default\wsus3setup.inf
2009-04-28	12:11:32:492	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\cdm.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuapi.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuapi.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuauclt.exe: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuaucpl.cpl: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuaucpl.cpl.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuaueng.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuaueng.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wucltui.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wucltui.dll.mui: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wups.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wups2.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	Update NOT required for C:\WINDOWS\system32\wuweb.dll: target version = 7.2.6001.788, required version = 7.1.6001.65
2009-04-28	12:11:32:507	 852	c80	Setup	WARNING: Warning: Setup callback ReportProgress failed: 0x8007000d
2009-04-28	12:11:32:507	 852	c80	Setup	  * IsUpdateRequired = No
2009-04-28	12:11:32:711	 852	c80	PT	+++++++++++  PT: Synchronizing server updates  +++++++++++
2009-04-28	12:11:32:711	 852	c80	PT	  + ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}, Server URL = http://BOL-APP2:80/ClientWebService/client.asmx
2009-04-28	12:11:32:820	 852	c80	PT	WARNING: Cached cookie has expired or new PID is available
2009-04-28	12:11:32:820	 852	c80	PT	Initializing simple targeting cookie, clientId = 97251052-2513-46bd-94a1-6cfaa1002681, target group = Productie Servers, DNS name = bol-vry.bolacc.nl
2009-04-28	12:11:32:820	 852	c80	PT	  Server URL = http://BOL-APP2:80/SimpleAuthWebService/SimpleAuth.asmx
2009-04-28	12:11:36:539	 852	c80	PT	+++++++++++  PT: Synchronizing extended update info  +++++++++++
2009-04-28	12:11:36:539	 852	c80	PT	  + ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}, Server URL = http://BOL-APP2:80/ClientWebService/client.asmx
2009-04-28	12:11:36:789	 852	c80	Agent	  * Found 0 updates and 42 categories in search; evaluated appl. rules of 190 out of 393 deployed entities
2009-04-28	12:11:36:789	 852	c80	Agent	*********
2009-04-28	12:11:36:789	 852	c80	Agent	**  END  **  Agent: Finding updates [CallerId = AutomaticUpdates]
2009-04-28	12:11:36:789	 852	c80	Agent	*************
2009-04-28	12:11:36:789	 852	c80	Report	REPORT EVENT: {FBE27556-DB6E-425F-9CA7-25714B2C4497}	2009-04-28 12:11:36:789+0200	1	147	101	{00000000-0000-0000-0000-000000000000}	0	0	AutomaticUpdates	Success	Software Synchronization	Windows Update Client successfully detected 0 updates.
2009-04-28	12:11:36:789	 852	1378	AU	>>##  RESUMED  ## AU: Search for updates [CallId = {BACECC32-0203-42FA-A92A-2A50D39FDF64}]
2009-04-28	12:11:36:789	 852	c80	Report	REPORT EVENT: {98DECCD7-720C-4505-9F4A-1AC4E5E4113B}	2009-04-28 12:11:36:789+0200	1	156	101	{00000000-0000-0000-0000-000000000000}	0	0	AutomaticUpdates	Success	Pre-Deployment Check	Reporting client status.
2009-04-28	12:11:36:789	 852	1378	AU	  # 0 updates detected
2009-04-28	12:11:36:789	 852	1378	AU	#########
2009-04-28	12:11:36:789	 852	1378	AU	##  END  ##  AU: Search for updates [CallId = {BACECC32-0203-42FA-A92A-2A50D39FDF64}]
2009-04-28	12:11:36:789	 852	1378	AU	#############
2009-04-28	12:11:36:804	 852	1378	AU	AU setting next detection timeout to 2009-04-28 14:24:43
2009-04-28	12:11:36:804	 852	1378	AU	Setting AU scheduled install time to 2009-04-28 20:00:00
2009-04-28	12:11:36:882	 852	c80	Report	Uploading 2 events using cached cookie, reporting URL = http://BOL-APP2:80/ReportingWebService/ReportingWebService.asmx
2009-04-28	12:11:36:898	 852	c80	Report	Reporter successfully uploaded 2 events.
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:

Select allOpen in new window

 

by: dstewartjrPosted on 2009-04-28 at 07:52:12ID: 24251393

Save below as update.hta(double click) and run from your desk against the server.

Does this also find 23 needed updates?

<html>
<!--*******************************************************************
Alan Kaplan for US VA, 11-28-2007. alan dot kaplan at va dot gov
This HTA allows you to check the patches that Windows Update/WSUS
reports are needed on a remote system, and to patch it remotely.
Also included is test for logged on user and session time.
Note that I use scheduled tasks because other remote execution types failed to work.
'*******************************************************************-->
<head><title>Remote Windows Update v 1 -- Alan Kaplan</title>
 
<HTA:APPLICATION
     APPLICATIONNAME="Remote Windows Update HTA"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
     contextmenu="True"
     id ="oRWUHTA"
>
</head>
 
 
<script language="VBScript">
 
Option Explicit
Dim strComputer, strHTML
dim oTable, oAllinputs, iPatchCount
Dim i, tArray, strMessage, oPopup
dim strPatch
Dim oPopBody
Dim objSession, updateSearcher, searchResult, update
Dim updatesToInstall, updatesToDownload
Dim downloader 
Dim retval, installer, installationResult
dim wshShell,command
Set wshShell = CreateObject("WScript.Shell")
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
Dim strScript
dim quote
quote=chr(34)
Dim strPatchScript, oTextStream
Dim strUserName, strPassword, strRmtDate, strRmtTime
Dim strPatchFile
Dim bFatal
bFatal = False
' Subs and Functions
 
Sub Window_OnLoad()
   self.ResizeTo 400,2
	On Error Resume Next
	'This to get the computer name as an argument
	Dim strCommandLine, strArgs, strProgPath
    strProgPath = replace(document.location.pathname,"%20",space(1))
	strCommandLine = oRWUHTA.commandLine
	strArgs = 	mid(strCommandline,instr(strCommandline,".hta")+7)
 
	  If Len(strArgs) > 0 Then 
		ComputerName.Value = strArgs
	 End If 
	 
	strUserName  = wshShell.ExpandEnvironmentStrings("%USERDOMAIN%\%USERNAME%")
	UserName.value = strUserName
	strmessage = 	"<font size=2><i>You are logged on as " & strUserName & ".<br>This account must have administrative rights on the remote system.</i></font> *****"
	strMessage = strMessage &  "<br><br>***** Enter the name of the computer to patch with Windows Update or WSUS"
 	showMessage strMessage
 	patchlist.innerhtml = "<font size = 5><center>Remote Windows Update Tool</center></font>"
 	self.Focus()
    'Width by length
    self.MoveTo 100,100
    self.ResizeTo 900,600
    ComputerName.Focus( )
End Sub 
 
Sub GetPatches()
	On Error Resume Next
	strComputer = ucase(cstr(computername.value))
	
	If Not PingReply() Then 
			MsgBox "Ping Failed!",vbCritical + vbOKOnly,strComputer
			showMessage "Failed to ping " & strComputer
			Exit Sub
	Else
			showMessage strComputer & " replied to ping."
	End If 
	
	strMessage = "Creating Update Session Object" & VbCrLf & _
	"(If this message persists you have a permission problem.)"
	showMessage strMessage
	Set objSession = CreateObject("Microsoft.Update.Session", strComputer)
	If Err <> 0 or isnull(objSession) Then 
		MsgBox "Failed!" & Err.Description,strComputer,vbCritical + vbOKOnly
		Exit Sub
	End If 
 
	showMessage "Connecting to " & strComputer
	Set updateSearcher = objSession.CreateupdateSearcher
	If Err <> 0 Then
		msgbox Err.Description
		Exit Sub
	End If 
	
	showMessage strComputer & " is getting the list of applicable updates" 
	
	Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
	If Err <> 0 Then
		msgbox Err.Description
		Exit Sub
	End If 
	
	Dim d, PatchNames, Descriptions
    Set d = CreateObject("Scripting.Dictionary")
    
	For I = 0 To searchResult.Updates.Count-1
	    Set update = searchResult.Updates.Item(I)
		Dim objCategories, strCatName, strMore
		Set objCategories = update.Categories
	    strCatName = objCategories.Item(0).Name
	
		If strCatName = "Security Updates" Then 
			strMore =  VbCrLf & ", severity: " & update.MsrcSeverity
		Else
			strMore = "."
		End If 
	
	    d.add update.Title, update.Description & VbCrLf & "Category: " & strCatName & strMore
	Next
	
	If searchResult.Updates.Count = 0 Then
		showMessage "There are no applicable updates."
		Exit Sub
	End If
 	
    showMessage "Creating collection of updates available to download"
		
 	strHTML = ""
 
	'This all ends up in a single cell, but I don't care
	
	strHTML = "<tr><td><tbody><font+3><b>Patch List for " & strComputer & ":</b></font><br><br>"
	
	PatchNames = d.Keys
    Descriptions = d.items
    	
	 For i = 0 To d.Count -1
	    strPatch = tArray(i)    
        strHTML =  strHTML & "<input type='checkbox' name='CheckBox" & i & _
        "' value=" & i & ">" & PatchNames(i) & ". Description: " & Descriptions(i) & "<br><br>"
       
  	Next
  
	strHTML =  strHTML &"</tbody></tr></td>"
  
    PatchList.InnerHTML = strHTML
    showMessage "Choose patches to install"
    runbutton.disabled = False
    selectbutton.disabled = False
 
End Sub
 
Sub SecOnly
	strUserName = username.value
	strPassword = PasswordBox.value
	If strUserName = "" Or strPassword="" Then
		MsgBox "Username and Password required", vbCritical + vbOKOnly,"Input Error"
		Exit Sub
	End If 
	
    strMessage = "All Security Patches"
    strComputer = ucase(cstr(computername.value))
    
	 If Not PingReply() Then 
			MsgBox "Ping Failed!",vbCritical + vbOKOnly,strComputer
			showMessage "Failed to ping " & strComputer
			Exit Sub
	Else
			showMessage strComputer & " replied to ping."
	End If 
	
	Dim strPatchFile
	strPatchFile = "\\"& strComputer & "\c$\patchlist.txt"
	On Error Resume Next
	
	If fso.FileExists(strPatchFile) Then fso.DeleteFile strPatchFile, true
	
	if err <> 0 then 
		MsgBox "Failed to delete old patchlist.txt from remote drive. " & Err.Description, vbcritical + vbokonly,strComputer
		showMessage "Fatal Error"
		Exit Sub
	End If 	
   	
   	Set oTextStream = fso.CreateTextFile(strPatchFile)
   	
   	If err <> 0 Then 
		MsgBox "Failed to write patchlist.txt to remote drive. " & Err.Description, vbcritical + vbokonly,strComputer
		showMessage "Fatal Error"
		Exit Sub
	End If 
	
   	oTextStream.Write(strMessage) 
	oTextStream.Close
	
    showMessage "Wrote " & strPatchFile
   MakeScript()
End Sub
 
Sub InstSelected
	strUserName = username.value
	strPassword = PasswordBox.value
	
	If strUserName = "" Or strPassword="" Then
		MsgBox "Username and Password required", vbCritical + vbOKOnly,"Input Error"
		Exit Sub
	End If 
	
    strMessage =""
	set otable = document.getElementById("PatchTable")
	set oAllInputs = otable.getElementsByTagName("input")
	
	Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")	
	
	for i = 0 To oallinputs.length -1
		if oallInputs(i).checked = true then 
			Set update = searchResult.Updates.Item(I)
		    strMessage = strMessage &  update.Title & vbcrlf 'write to control list on remote system
		End If 
	Next
	
	strPatchFile = "\\"& strComputer & "\c$\patchlist.txt"
	If fso.FileExists(strPatchFile) Then fso.DeleteFile strPatchFile, true
	
	if err <> 0 then 
		MsgBox "Failed to delete old patchlist.txt from remote drive. " & Err.Description, vbcritical + vbokonly,strComputer
		showMessage "Fatal Error"
		Exit Sub
	End If 	
	
	
	
   	Set oTextStream = fso.CreateTextFile(strPatchFile)
   	oTextStream.Write(strMessage) 
 
   	
   	If err <> 0 Then 
		MsgBox "Failed to write patchlist.txt to remote drive. " & Err.Description, vbcritical + vbokonly,strComputer
		showMessage "Fatal Error"
		Exit Sub
	End If 
 
 
    showMessage "Wrote " & strPatchFile
    
   MakeScript()
 End Sub
 
 Sub SelectDeselect
      
	    Set otable = document.getElementById("PatchTable")
    	Set oAllInputs = otable.getElementsByTagName("input")
    		
        If selectButton.Value = "Select All" Then
            SelectButton.Value = "Deselect All"
            for i = 0 to oallinputs.length -1
       			oallInputs(i).checked = true
            next
        Else
            SelectButton.Value = "Select All"
            for i = 0 to oallinputs.length -1
       			oallInputs(i).checked = false
            next
        End If
End Sub
 
 
Function CurrentUser(strComputer)
	Dim oComputerSys, oUserInfo
	Set oComputerSys = oWMI.InstancesOf("Win32_ComputerSystem")
	If (Err.Number <> 0)  Then 
	MsgBox "Error.  Failed to Query WMI",vbCritical + vbOKOnly,"Error" 
		showMessage "Error.  Failed to Query WMI"
		bFatal = True
		Exit Function	
	End If 
	
		 For Each oUserInfo In oComputerSys
		     If not isnull(oUserInfo.Username) Then 
		      	CurrentUser = oUserInfo.UserName 'name here is in domain\samname format
		      End If 
		      
			  If IsEmpty(CurrentUser) Then
				     MsgBox "No user is logged onto " & strComputer,vbCritical + vbOKOnly ,"Error"
				     showMessage "No User is logged on"
			  End If
		  Next 
	
End Function 
 
 
 
Sub doPopup(strText, iXlocation, iYLocation)  ' just for show...
	Dim iWidth, iHeight
 
	set oPopup = window.createPopup
    set oPopBody = oPopup.document.body
    oPopBody.style.backgroundColor = "lightyellow"
    oPopBody.style.border = "solid black 1px"
    oPopBody.innerHTML = space(1) & strText
    'show(x-location, y-location, width, height, reference-element);
    'oPopup.show obutton.clientwidth, obutton.clientheight, len(strText)*10, 25,  document.body
    If len(strText) < 80 Then
     	iWidth = Len(strText)*10
        iHeight = 25
    Else
     	iWidth = (Len(strText)*10) / 3
        iHeight = 25 *3    	
    End If 
    oPopup.show iXLocation, iYLocation ,iWidth, iHeight, document.body
End Sub
 
Sub closePopup
    oPopup.hide
end Sub
 
Sub showMessage(lsMsg)  
	Message.innerHTML= "***** " & lsMsg & " *****"  
	Message.style.display=""  
	command = "%COMSPEC% /c"  
	wshShell.Run command,0,1  
End Sub  
 
  
Sub hideMessage()
	Message.innerHTML=""  
	Message.style.display="none"  
end Sub
 
Sub MakeScript()
	'Create script on remote system
	strScript = "'=== This is a temp file.  It is okay to delete it. ===" & vbcrlf & _ 
	"'======= Alan Kaplan, created by WindowsUpdate.hta ==========" & vbcrlf & _ 
	"dim fso,logfile, bReboot, appendout" & vbcrlf & _ 
	"Const ForAppend = 8" & vbcrlf & _ 
	"Set fso = CreateObject(" & quote & "Scripting.FileSystemObject" & quote & ")" & vbcrlf & _ 
	"Dim strPatchFile, strPatchList" & vbcrlf & VbCrLf & _ 
	"bReboot = True" & VbCrLf & _
	"If wscript.arguments.count > 0 then bReboot = False" & VbCrLf  & _
	"On Error Resume Next" & vbcrlf & _ 
	"logfile = " & quote & "c:\RemoteWSUSLog.txt" & quote & "	'Name of log file.  Can open in Excel." & vbcrlf & _ 
	"strPatchfile = " & quote & "c:\PatchList.txt" & quote & "" & vbcrlf & _ 
	"Set appendout = fso.OpenTextFile(logfile, ForAppend, True)" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"If not fso.FileExists(strPatchFile) Then" & vbcrlf & _ 
	"	WriteLog strPatchFile & " & quote & " not found, quitting" & quote & "" & vbcrlf & _ 
	"	WScript.Quit" & vbcrlf & _ 
	"End If " & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Set f=fso.OpenTextFile(strPatchFile,1,False)" & vbcrlf & _ 
	"strPatchList = f.readall" & VbCrLf & _ 
	"Dim bSecurity"& VbCrLf & _ 
	"If strPatchList = " & quote & "All Security Patches" & quote & " Then bSecurity = True"& VbCrLf & _ 
	"" & VbCrLf & _ 
	"if bReboot = False then" & VbCrLf & _ 
	"WriteLog " & quote & "Launched with no reboot set" & quote &  VbCrLf & _ 
	"" & VbCrLf & _ 
	"   Else" & VbCrLf & _ 
	"WriteLog " & quote & "Launched permitting reboot if not user is logged on "& quote & VbCrLf & _ 
	"" & VbCrLf & _ 	
	"End If " & VbCrLf & _ 
	"" & VbCrLf & _ 
	"Set oSession = CreateObject(" & quote & "Microsoft.Update.Session" & quote & ")" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Set updateSearcher = oSession.CreateupdateSearcher" & vbcrlf & _ 
	"If Err <> 0 Then" & VbCrLf & _ 
	"	WriteLog " &  quote & "Update Searcher not created" & quote & " & Err.Description" & VbCrLf & _ 
	"	WScript.Quit" & VbCrLf & _ 
	"End If " & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Set searchResult = updateSearcher.Search(" & quote & "IsInstalled=0 and Type='Software'" & quote & ")" & vbcrlf & _ 
	"If Err <> 0 Then" & VbCrLf & _ 
	"	WriteLog " & quote & "Update Search function failed." & quote & "&  Err.Description" & vbcrlf & _ 
	"	WScript.Quit" & VbCrLf & _ 
	"End If " & vbcrlf & _ 
	"" & vbcrlf & _ 
	"If searchResult.Updates.Count = 0 Then" & vbcrlf & _ 
	"	WriteLog " & quote & "There are no applicable updates." & quote & "" & vbcrlf & _ 
	"	WScript.Quit" & VbCrLf & _ 
	"End If" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"'Creating collection of updates to download" & vbcrlf & _ 
	"Set updatesToDownload = CreateObject(" & quote & "Microsoft.Update.UpdateColl" & quote & ")" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"For I = 0 to searchResult.Updates.Count-1" & vbcrlf & _ 
	"    Set update = searchResult.Updates.Item(I)" & VbCrLf & _
	"	Set objCategories = update.Categories" & VbCrLf & _
	"	strCatName = objCategories.Item(0).Name" & VbCrLf & VbCrLf & _
	"	If bSecurity Then " & VbCrLf & _
	"		If strCatName = " & quote & "Security Updates" & quote & " Then " & VbCrLf & _
	"	    WriteLog " & quote & "adding " & quote & " & update.Title & " & quote & " to download list." & quote  & vbcrlf & _ 
	"			updatesToDownload.Add(update) " & VbCrLf & _
	"		End If" & VbCrLf & _
	"	Else" & VbCrLf & _
	"    If InStr(strPatchList, update.Title) Then " & vbcrlf & _ 
	"	    WriteLog " & quote & "adding " & quote & " & update.Title & " & quote & " to download list." & quote  & vbcrlf & _ 
	"	    updatesToDownload.Add(update)" & vbcrlf & _ 
	"    End If " & VbCrLf & _ 
	"  End If " & VbCrLf & _ 
	"Next" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"'Downloading updates..." & VbCrLf & _
	"If updatestoDownload.count = 0 Then" & VbCrLf & _
	"	WriteLog " & quote & "No patches meeting criteria found to download, quitting." & quote & VbCrLf & _
	"	WScript.Quit" & VbCrLf & _
	"End If" & VbCrLf & _
	"Set downloader = oSession.CreateUpdateDownloader() " & vbcrlf & _ 
	"downloader.Updates = updatesToDownload" & vbcrlf & _ 
	"downloader.Download()" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Set updatesToInstall = CreateObject(" & quote & "Microsoft.Update.UpdateColl" & quote & ")" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"'Creating collection of downloaded updates to install" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"For I = 0 To searchResult.Updates.Count-1" & vbcrlf & _ 
	"    set update = searchResult.Updates.Item(I)" & vbcrlf & _ 
	"    If update.IsDownloaded  Then" & vbcrlf & _ 
	"	    WriteLog " & quote & "adding " & quote & " & update.Title & " & quote & " to install list." & quote & vbcrlf & _ 
	"	    updatesToInstall.Add(update)	" & vbcrlf & _ 
	"    End If" & vbcrlf & _ 
	"Next" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"WriteLog " & quote & "Installing updates..." & quote & "" & vbcrlf & _ 
	"Set installer = oSession.CreateUpdateInstaller()" & vbcrlf & _ 
	"installer.Updates = updatesToInstall" & vbcrlf & _ 
	"Set installationResult = installer.Install()" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"'Output results of install" & vbcrlf & _ 
	"WriteLog " & quote & "Installation Result: " & quote & " &	Code2Text(installationResult.ResultCode)" & vbcrlf & _ 
	"WriteLog  " & quote & "Reboot Required: " & quote & " & installationResult.RebootRequired " & vbcrlf & _ 
	"strMessage = " & quote & "Listing of updates installed " & quote & " & _" & vbcrlf & _ 
	" " & quote & "and individual installation results:" & quote & "  & VbCrLf " & vbcrlf & _ 
	"" & vbcrlf & _ 
	"For I = 0 to updatesToInstall.Count - 1" & vbcrlf & _ 
	"	strMessage =  VbCrLf & strMessage & vbtab & updatesToInstall.Item(i).Title & _" & vbcrlf & _ 
	"	" & quote & ": " & quote & " & code2text(installationResult.GetUpdateResult(i).ResultCode)" & vbcrlf & _ 
	"Next" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"WriteLog strMessage" & VbCrLf & _ 
	"" & VbCrLf & _ 
	"If Not(UserLoggedOn) and bReboot and installationResult.RebootRequired then" & vbcrlf & _ 
	"		WriteLog " & quote & "Done.  Rebooting computer" & quote & "" & vbcrlf & _ 
	"		strComputer = " & quote & "." & quote & "" & vbcrlf & _ 
	"		Set objWMIService = GetObject(" & quote & "winmgmts:" & quote & " _" & vbcrlf & _ 
	"		& " & quote & "{impersonationLevel=impersonate,(Shutdown)}!\\" & quote & " & strComputer & " & quote & "\root\cimv2" & quote & ")" & vbcrlf & _ 
	"		" & vbcrlf & _ 
	"		Set colOperatingSystems = objWMIService.ExecQuery (" & quote & "Select * from Win32_OperatingSystem" & quote & ")" & vbcrlf & _ 
	"		" & vbcrlf & _ 
	"		For Each objOperatingSystem in colOperatingSystems" & vbcrlf & _ 
	"			ObjOperatingSystem.Reboot()" & vbcrlf & _ 
	"		Next" & vbcrlf & _ 
	"	Else" & vbcrlf & _ 
	"		WriteLog " & quote & "Done.  Logged on user, not rebooting computer" & quote & "" & vbcrlf & _ 
	"End if" & vbcrlf & _ 
	"Sub WriteLog (message)" & vbcrlf & _ 
	"	message = now & vbTab &  message" & vbcrlf & _ 
	"	AppendOut.WriteLine message" & vbcrlf & _ 
	"End Sub  " & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Function UserLoggedOn()" & vbcrlf & _ 
	"	UserLoggedOn = False" & vbcrlf & _ 
	"	Dim wshshell" & VbCrLf & _ 
	"	Set wshShell = WScript.CreateObject(" & quote & "WScript.Shell" & quote & ")" & vbcrlf & _ 
	"	Dim objLocator, objWMIService, objUserInfoList, objUserInfo" & vbcrlf & _ 
	"	strComputer = wshShell.ExpandEnvironmentStrings(" & quote & "%COMPUTERNAME%" & quote & ")" & vbcrlf & _ 
	"	set objLocator = CreateObject(" & quote & "WbemScripting.SWbemLocator" & quote & ")" & vbcrlf & _ 
	"	set objWMIService = objLocator.ConnectServer(strComputer) " & vbcrlf & _ 
	"	Set objUserInfoList = objWMIService.InstancesOf(" & quote & "Win32_ComputerSystem" & quote & ")" & vbcrlf & _ 
	"	For Each objUserInfo in objUserInfoList" & vbcrlf & _ 
	"   		If not isnull(objUserInfo.Username) Then  " & vbcrlf & _ 
	"    		UserLoggedOn = True" & vbcrlf & _ 
	"    		Exit Function " & vbcrlf & _ 
	"   		End If  " & VbCrLf & _ 
	"	Next" & vbcrlf & _ 
	"End Function" & vbcrlf & _ 
	"" & vbcrlf & _ 
	"Function Code2Text(iCode)" & vbcrlf & _ 
	"	If iCode = 2 Then " & vbcrlf & _ 
	"		Code2Text = " & quote & "Okay" & quote & "" & vbcrlf & _ 
	"	Else" & VbCrLf & _ 
	"		Code2Text = " & quote & "Failed" & quote & "" & VbCrLf & _ 
	"	End If " & VbCrLf & _ 
	"End Function "
 
    'Whew!
	
	strPatchScript = "\\"& strComputer & "\c$\patchscript.vbs"
	If fso.FileExists(strPatchScript) Then fso.DeleteFile strPatchScript, true
	
   	Set oTextStream = fso.CreateTextFile(strPatchScript)
   	oTextStream.Write(strScript) 
	oTextStream.Close
	
    showMessage "Wrote " & strPatchScript
 
    MakeJob()
End Sub
 
 
Sub BtnUpdate
   button1.disabled = False
   If Radio1(0).Checked Then
		button1.value = "Get Patch List"        
   Else
		button1.value = "Launch Security Update Install"      		
   End if 
End Sub
 
Sub SelectedOption		
   If Radio1(0).Checked Then
        GetPatches
    End If
    If Radio1(1).Checked Then
        SecOnly
    End If
End Sub
 
 
Function PingReply()
	PingReply = False
 	Dim objWMIService, colPings, objPing
    Set objWMIService = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\\.\root\cimv2")
    Set colPings = objWMIService.ExecQuery _
      ("SELECT * FROM Win32_PingStatus WHERE Address = '" & strComputer & "'")
      
    For Each objPing in colPings
        if objPing.StatusCode = 0 Then 
        PingReply = True
       	Exit Function
       	End If 
    Next
 
End Function
 
 
Sub MakeJob()
	On Error resume Next
	Dim strCommand , retval
	Dim iTime, strNewTime
	strComputer = ucase(computername.value)	
	Dim fso, strJobFile
	strJobfile = "\\"& strComputer & "\admin$\tasks\RunOnce.job"
	set fso = CreateObject("Scripting.FileSystemObject")
	If fso.FileExists(strJobFile) Then		fso.DeleteFile strJobFile, True
	
	if err <> 0 Then 
		MsgBox "Failed to delete old job " & err.Description, vbcritical + vbokonly,strComputer
		Exit Sub
	End If 
	
	RemoteDateTime()
	
	showMessage "Creating scheduled task for patching"
	
	iTime = minutes.value
	If iTime = 0 Then iTime = 1	'minimum delay 1 minute
	
	'Add minutes
	strNewTime = DateAdd("n", minutes.value, time)
	'format as military Time String
	strCommand = "\\" & strComputer & "\admin$\system32\wscript.exe c:\patchscript.vbs "
	If document.getElementbyID("C1").checked = false  Then strCommand = strCommand & " noReboot"
	
	strNewTime= cstr(FormatDateTime(strNewTime, vbShortTime))& ":00"
	strcommand = "SCHTASKS /s " & strComputer & " /Create /SC once /TN RunOnce /TR " & quote & strCommand & quote &_
      " /ST "& strNewTime & " /RU " & quote & strUserName & quote & " /RP " & quote & strpassword & quote
 
	retval = WshShell.Run(strCommand, 0, True) 
	If retval = 0 Then
	   showMessage "The patch task was successfully created to start at " & strNewTime & ". Press Clear button to reset"
	Else
	   strMessage ="There were problems creating the patch task. " & Err.Description & ". Press Clear button to reset"
	   showMessage strMessage
	   MsgBox strMessage, vbCritical + vbOKOnly, "Fatal Error"
	End If
	
 End Sub
 
 
Sub RemoteDateTime()
	showMessage "Getting time on " & strComputer
	On Error Resume Next
	Dim oWMI, colItems, objItem
	Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
		if err <> 0 then 
		MsgBox "WMI Failure " & err.Description, vbcritical + vbokonly,strComputer
		Exit Sub
	End if 
	Set colItems = oWMI.ExecQuery("SELECT * FROM Win32_Localtime",,48)
	For Each objItem In colItems
		strRmtDate = objItem.Year & "-" & padNum(objItem.Month) & "-" & padnum(objItem.Day)
		strRmtTime = objItem.Hour & ":" & padNum(objItem.Minute) & ":" & padnum(objItem.Second)
	Next
	showMessage "Time on " & strComputer & " is " & strRmtTime
End Sub 
 
Function PadNum(strNum)
	If Len(strnum) = 1 Then 
		padnum = "0" & strnum
	Else 
		PadNum = strNum
	End If 
End Function
 
 
Sub CheckUser()
	If computername.value = "" Then 
		MsgBox "Enter computer name first!",vbCritical + vbOKOnly, "User Error"
		Exit Sub
	End If 
 
	strComputer = ucase(computername.value)
	strMessage = "Current user: " & RemoteComputerUsers(strcomputer)
 
	If bFatal = True Then 
		showMessage "Fatal Error - Use Clear button to reset"
		bFatal = False
		Exit Sub
	End If 
	
	If InStr(strMessage,"(None)") = 0 Then
		strMessage = strMessage & VbCrLf &  "Session Time: " & Sessiontime & VbCrLf & _
	    "Continue forced logoff of this user? Logoff is immediate and without notice!"
	    retval = MsgBox(strMessage, vbYesNo + vbQuestion,"Continue?")
		If retval = vbYes Then Logoff strComputer
	Else
		retval = MsgBox(strMessage,vbOKOnly + vbInformation, strComputer)
	End If 
 
End Sub 
 
 
Sub Logoff(strComputer)
	Dim objOSItem, colOSItems
	On Error Resume Next		' continue On Error
	
	Set colOSItems=GetObject("winmgmts:{(Debug,RemoteShutdown)}//" _
	            	& strComputer & "/root/cimv2").ExecQuery( _
	              	"Select * from Win32_OperatingSystem where Primary=true")
	If Err > 0 Then
		MsgBox "Force logoff to "& strComputer & " failed. "  & Err.Description, vbCritical  + vbOKOnly,"Success"
		Exit Sub 
	End If  
	
	For each objOSItem In colOSItems
		objOSItem.Win32Shutdown(4) 'Force Logoff
		MsgBox "Sent force logoff to "& strComputer, vbInformation + vbOKOnly,"Success"
	Next 
	On Error goto 0
End Sub  
 
Function Sessiontime()
	On Error Resume Next 
	'I have not seen any other vbscript that does this well
	Dim oWMI, ColSessions, objSession, strLogonTime
	Dim iElapsedTime, iHours, iMinutes
	Set oWMI = GetObject("winmgmts:" _
			& "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")
	Set ColSessions = oWMI.ExecQuery("Select * from Win32_LogonSession where LogonType=2",,48)
	strLogonTime  = 0
	If Err > 0 Then
		MsgBox "Getting session information from "& strComputer & " failed. "  & Err.Description, vbCritical  + vbOKOnly,"Success"
		bFatal = True
		Exit Function  
	End If  
 
 
	
	For Each objSession In ColSessions
	   If WMIDateStringToDate(objSession.StartTime) > strLogonTime Then 
	   	  strLogonTime = WMIDateStringToDate(objSession.StartTime)
	   End If 
	Next
		
	iElapsedTime = MinutesDiff(strLogonTime)
	iHours = int(iElapsedTime /60)
	iMinutes = iElapsedTime Mod 60
	Sessiontime = iHours & " Hours " & iMinutes & " minutes."
End Function
 
Function RemoteComputerUsers (strComputer)
	strMessage =""
	Dim otrans, strDom
	strDom = wshShell.ExpandEnvironmentStrings("%USERDNSDOMAIN%")
 
	On Error Resume Next
	'Cut and pasted from another script and a bit lazy - I could have connected 1x to WMI.. 
	Set otrans = CreateObject("NameTranslate")
	oTrans.Init 1, strDom	' initialize NameTranslate with NT style Domain name
 
	Dim objLocator, objWMIService, objUserInfoList, objUserInfo
	set objLocator = CreateObject("WbemScripting.SWbemLocator")
	set objWMIService = objLocator.ConnectServer(strComputer) 
 
	If Err.Number <> 0 Then
		MsgBox "Error reaching or connecting to WMI on " & strComputer,vbcritical & vbokonly, "Failed"
		bFatal = True
		Exit Function
	End If
 
	Set objUserInfoList = objWMIService.InstancesOf("Win32_ComputerSystem")
	If (Err.Number = 0)  Then
		For Each objUserInfo in objUserInfoList
    		If not isnull(objUserInfo.Username) Then  
	    		strMessage = strMessage &  objUserInfo.UserName & vbTab
		        oTrans.Set 8,objUserInfo.UserName 				'name here is in domain\samname format
	   			strMessage = strMessage & "(" & oTrans.Get(4) & ")" 	'Get DisplayName
	   		End If  
		Next
	Else
		strMessage = Err.Description
	End If
 
	If  strMessage = ""  Then 
 		strMessage = "(None)"
 	End If
	RemoteComputerUsers = strMessage
End Function
 
Function MinutesDiff(theTime)
  MinutesDiff = DateDiff("n", theTime, now)
End Function
 
Function WMIDateStringToDate(utcDate)
	WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
	Mid(utcDate, 7, 2) & "/" & _
	Left(utcDate, 4) & " " & _
	Mid(utcDate, 9, 2) & ":" & _
	Mid(utcDate, 11, 2) & ":" & _
	Mid(utcDate, 13, 2))
End Function
 
 
Sub Clear()
    'Location.Reload(True)	'This reloads, clearing all
    bFatal = False
    c1.checked = True		'Instead, I am keeping username and password
    computername.value = ""
    PatchList.innerhtml = ""
    Radio1(0).Checked = False
    Radio1(1).Checked = False
    ComputerName.Focus( )
  	patchlist.innerhtml = "<font size = 5><center>Remote Windows Update Tool</center></font>"
    showMessage "Enter Another Computer Name"
End Sub 
 
 
</script>
 
<BODY STYLE="font:12 pt arial; color:white; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#0000FF', EndColorStr='#000000')">
     
  <div align="center">
<table border="0" width="90%" id="PatchTable" >
	<tr><td><span id='PatchList'></span></td></tr>
</table>
<p>
<input type="button" name="LoggedonBtn" value="Logged On User"  onclick="CheckUser" 
 onmouseover="doPopup 'Get remote user and session time.  Choice to force logoff.', 140,55"  
 onmouseout="closePopup"style="float: Right"></div>
<form method="POST">
</form>
<p>
<font size="3">Enter Computer Name:</font>
<INPUT TYPE="text" NAME="ComputerName" SIZE="20" 
onmouseover="doPopup 'Enter name of computer', 140,55"  onmouseout="closePopup" >&nbsp;&nbsp;
<table border="0" width="974" height="57">
  <tr>
    <td height="57" width="309">
 
<input type="radio" name="Radio1" value="1" onclick ="BtnUpdate" title="Will create a list of the available patches">View Available Patches<br>
<input type="radio" name="Radio1" value="2" onclick ="BtnUpdate" title = "Select to install without query" >Install All Security Updates</td>
    <td height="57" width="309">
<input type="button" name="button1" disabled = True value="Choose" onclick="SelectedOption">
    </td>
    <td height="57" width="344">
</td>
  </tr>
</table>
 
  <div align="center">
    <table border="0" width="100%" id="table1">
      <tr>
        <td><input type="checkbox" id="C1" name="C1" value="ON" checked
  onmouseover="doPopup 'This program will reboot the remote system (if required) after an update completes unless there is a logged on user. Uncheck if this is a server that you want to manually reboot.', 40,100"  
  onmouseout="closePopup" > Permit reboot if no user logged on.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 </td>
      <td>      
  &nbsp;</td>
      </tr>
      <tr>
  
    
      </tr>
    </table>
    <p>
 
<input id=Clearbutton type="button" value="Clear" name="ClearBtn"  onClick="Clear" style="float: right"></div>
 
  </p>
 
 
<p>
<input id=SelectButton  type="button"  disabled= True value="Select All" onClick="SelectDeselect"> 
<input id=runbutton  type="button" disabled= true  value="Install Selected Patches" onClick="InstSelected"></p>
<p>Please enter a username
<input type="text" name="UserName" size="30">
 
 
and a password&nbsp;  
<input type=password Name = "PasswordBox" size="20">&nbsp; to be used as the credentials 
for the task that runs the patch script on the remote system.&nbsp; Delay in minutes 
before patch begins:&nbsp; 
<input type ="text" name = "minutes" size = 4 value="3"></p>
<span id="Message"</span><br>
&nbsp;
</body>
</html>
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
726:
727:
728:
729:
730:
731:
732:
733:
734:
735:
736:
737:
738:
739:
740:
741:
742:
743:
744:
745:
746:
747:
748:
749:
750:
751:
752:
753:
754:
755:
756:
757:
758:
759:
760:
761:
762:
763:
764:
765:
766:
767:
768:
769:
770:
771:
772:
773:
774:
775:
776:
777:
778:
779:
780:
781:
782:
783:
784:
785:
786:
787:
788:
789:
790:
791:
792:
793:
794:
795:
796:
797:
798:
799:
800:
801:
802:
803:
804:
805:
806:
807:
808:
809:
810:
811:
812:
813:
814:
815:
816:
817:
818:
819:
820:
821:
822:
823:
824:

Select allOpen in new window

 

by: BolAccPosted on 2009-04-28 at 23:50:01ID: 24257822

I used your script, on the clients it works fine. But if i try a server: There are no applicable updates.

 

by: dstewartjrPosted on 2009-04-29 at 06:39:50ID: 24260290

This suggests that the servers may be really at 100%

If you were to manually download 1 of these 23 updates, do they install ?

 

by: BolAccPosted on 2009-04-29 at 06:50:33ID: 24260399

I tried to install KB961373 on one of our servers who gives the 100% status. And the update was succesful. Also on this server there are 22 other updates waiting, and the are ALL approved in WSUS?

 

by: dstewartjrPosted on 2009-04-29 at 07:33:49ID: 24260908

Lets try updating all the windows update components.

http://cid-42eeb87f9c74d86f.skydrive.live.com/browse.aspx/Tools <<<download and extract this tool(click on folder above comments for download) Then run the RunMe_AUClientTool.bat. It will update/reinstall key components.

Then reinstall windowsupdateagent, you will need to use the /wuforce switch

http://go.microsoft.com/fwlink/?LinkID=91237

then run the previous script(fixwsus.cmd) so we clear out the distribution folder.

 

by: dstewartjrPosted on 2009-04-29 at 07:38:10ID: 24260958

You may also be experiencing this because of a "Pending Reboot"

http://blogs.msdn.com/hansr/archive/2006/02/17/PatchReboot.aspx

 

by: BolAccPosted on 2009-04-29 at 08:14:36ID: 24261374

I found the problem! it was quite easily. The update server was configured for Dutch updates, but the servers are English. I selected the english updates, and voila the servers report that there are updates!

dstewartjr! thanx for all the help!

 

by: dstewartjrPosted on 2009-04-29 at 08:30:39ID: 24261584

Ahhh, No wonder!!! GOOD CATCH!!!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...