We use a lot of imaging using Altiris Deployment Solutions. Apparently computers do not report to the WSUS console as computer name, but some other special identifier. And imaging just copies this identifier. The symptom was that one computer would show up in the console, and then vanish and replaced by another. And then vanish and re replace by another. The script below runs as a start up GPO and fixes the imaging issue as well as a other issues with windows update and WSUS. The script looks for errors in the update logs and if finding them performs corrective measures. Remember, be sure to test it thoroughly in your environment before moving it into production.
I appologize for the word wrapping, but if you copy and paste the following into a text document (or .bat) then the wrap should be removed.
BEGIN SCRIPT
EVENTCREATE /SO “GPO WSUSfix.bat Begin” /T INFORMATION /ID 2 /L SYSTEM /D “This is a GPO start up script. A Begin entry should follow by an End entry. If not, you may have a hanging Script.”
ECHO %DATE% – %TIME% – Begin GPO WSUS_fix.bat >> %WINDIR%\TEMP\GPO.StartupScript_GPO WSUS_fix.bat.log
set isError=no
REM ####################################
REM ###
REM ### This section applies to all computers
REM ### and can be reset at each computer boot
REM ###
REM ####################################
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)”
REM ####################################
REM ####################################
REM ####################################
REM ### Windows Update Agent
REM ### Searching the log file for
REM ### “EEHndlr FATAL: MSI DLL version is”
REM ### This is a sign that the Windows Update agent its self needs updating
REM ###
REM ####################################
findstr /C:”EEHndlr FATAL: MSI DLL version is ” %windir%\WindowsUpdate.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDStringUpdateAgent
goto EndOfUpdateAgent
:FOUNDStringUpdateAgent
set isError=yes
set FIX=UpdateAgent-%fix%
ECHO Fix Found the String ‘EEHndlr FATAL: MSI DLL version is ‘
NET STOP “Dell ControlPoint System Manager”
NET STOP “Dell ControlPoint Button Service”
NET STOP “Intel(R) Matrix Storage Event Monitor”
NET STOP “Automatic Updates”
NET STOP “Background Intelligent Transfer Service”
NET STOP “Vision Control Manager”
NET STOP wuauserv
ECHO reinstalling WindowsUpdateAgent30-x86.exe /quiet /wuforce
“\\DOMAINNAME.local\SysVol\DOMAINNAME.local\Policies\{977B5A30-8265-41AC-913A-1466A3919303}\Machine\Scripts\Startup\WindowsUpdateAgent30-x86.exe” /quiet /wuforce
:EndOfUpdateAgent
ECHO END of section Update Agent
REM ##################################
REM ### Windows Installer Update
REM ##################################
REM ##################################
REM ####################################
REM ###
REM ### IMAGE FIX CHECK
REM ###
REM ### Checks to see if Image fix has ever been run.
REM ### If not, it runs it once and marks that it has been run
REM ### by placing the computer name in %windir%\WindowsUpdate_ImageFix.log
REM ### Later, if an Image is taken from this computer, the imaged computers will
REM ### have a matching computername in %windir%\WindowsUpdate_ImageFix.log
REM ### and they will then run the fix again.
REM ####################################
if exist %windir%\WindowsUpdate_ImageFix.log (goto Step2OfImageFix)
echo no %windir%\WindowsUpdate_ImageFix.log
goto FOUNDString
:Step2OfImageFix
findstr /C:%COMPUTERNAME% %windir%\WindowsUpdate_ImageFix.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDStringImageFix
ECHO Did not find ‘%COMPUTERNAME%’ in %windir%\WindowsUpdate_ImageFix.log
goto FoundString
:FOUNDStringImageFix
ECHO found string ‘%COMPUTERNAME%’ in %windir%\WindowsUpdate_ImageFix.log
Goto :EndOfImageFix
REM ##################################
:EndOfImageFix
REM ##################################
REM ##################################
REM ### END OF Image Fix Check
REM ##################################
REM ##################################
REM ####################################
REM ### Section Second Image Update Fix
REM ### 1> FATAL: Error: 0x8007045a. wuauclt datastore: failed to load wuaueng
REM ### 2> FATAL: Unable to connect to the service
REM ####################################
findstr /C:”FATAL: Error: 0x8007045a. wuauclt datastore: failed to load wuaueng” %windir%\WindowsUpdate.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDString
findstr /C:”FATAL: Unable to connect to the service” %windir%\WindowsUpdate.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDString
REM ##################################
REM ### If the String IS NOT found move on
REM ##################################
ECHO Did not Find the string ‘FATAL: Error: 0x8007045a. wuauclt datastore: failed to load wuaueng’
REM ##################################
goto :EndOfwuaueng
REM ##################################
REM ###########################################
REM ### If the String is found then we need to know if 2k or XP
REM ###########################################
:FOUNDString
set isError=yes
set FIX=Image-%fix%
NET STOP “Dell ControlPoint Button Service”
NET STOP “Dell ControlPoint System Manager”
NET STOP “Smith Micro Connection Manager Service”
NET STOP “Intel(R) Matrix Storage Event Monitor”
NET STOP “Automatic Updates”
NET STOP “Vision Control Manager”
NET STOP “Background Intelligent Transfer Service”
NET STOP wuauserv
NET STOP “Windows Firewall/Internet Connection Sharing (ICS)”
NET STOP “Windows Management Instrumentation”
ECHO Fix Found the String ‘FATAL: Error: 0x8007045a. wuauclt datastore: failed to load wuaueng’
ver | findstr XP
If %ERRORLEVEL% EQU 0 Goto isXP
ver | findstr 2000
If %ERRORLEVEL% EQU 0 Goto is2000
goto :EndOfwuaueng rem ### EXIT SCRIPT IF NOT 2000 OR XP
REM ##################################
REM ### IS WINDOWS XP
REM ##################################
:isXP
REM ### Update Agent Fix — Not sure if this section is needed here with the section devoted to it.
REM ECHO reinstalling WindowsUpdateAgent30-x86.exe /quiet /wuforce
REM “\\DOMAINNAME.local\SysVol\DOMAINNAME.local\Policies\{977B5A30-8265-41AC-913A-1466A3919303}\Machine\Scripts\Startup\WindowsUpdateAgent30-x86.exe” /quiet /wuforce
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
REM #######– Clean up Log file –#############
ECHO Image Fix %date% %time% ‘%COMPUTERNAME%’ > %windir%\WindowsUpdate_ImageFix.log
goto :EndOfwuaueng REM do not execute IS WINDOWS 2000 Section
REM ##################################
REM ##################################
REM ### IS WINDOWS 2000
REM ##################################
:is2000
REM ### Update Agent Fix — Not sure if this section is needed here with the section devoted to it.
REM ECHO reinstalling WindowsUpdateAgent30-x86.exe /quiet /wuforce
REM “\\DOMAINNAME.local\SysVol\DOMAINNAME.local\Policies\{977B5A30-8265-41AC-913A-1466A3919303}\Machine\Scripts\Startup\WindowsUpdateAgent30-x86.exe” /quiet /wuforce
regedit.exe /s “\\DOMAINNAME.local\SysVol\DOMAINNAME.local\Policies\{977B5A30-8265-41AC-913A-1466A3919303}\Machine\Scripts\Startup\win2000 WSUS fix.reg” REM this may error as the script is probably not executed at sysvol dir.
REM #######– Clean up Log file –#############
ECHO Image Fix %date% %time% ‘%COMPUTERNAME%’ > %windir%\WindowsUpdate_ImageFix.log
goto :EndOfwuaueng
:EndOfwuaueng
ECHO END of section wuaueng
REM ##################################
REM ##################################
REM ### END OF wuaueng section
REM ##################################
REM ##################################
REM ####################################
REM ### Section Send Failed
REM ### Searching the log file for
REM ### the applicable errors
REM ### 1> WARNING: WU client failed Searching for update with error 0x80072ee2
REM ### 2> WARNING: Send failed with hr = 80072ee2
REM ####################################
findstr /C:”WARNING: Send failed with hr = 80072ee2.” %windir%\WindowsUpdate.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDStringSendFailed
goto EndOfSendFailed
:FOUNDStringSendFailed
set isError=yes
set FIX=SendFailed-%fix%
ECHO Fix Found the String ‘WARNING: Send failed with hr = 80072ee2.’
NET STOP “Dell ControlPoint Button Service”
NET STOP “Dell ControlPoint System Manager”
NET STOP “Smith Micro Connection Manager Service”
NET STOP “Intel(R) Matrix Storage Event Monitor”
NET STOP “Automatic Updates”
NET STOP “Background Intelligent Transfer Service”
NET STOP wuauserv
NET STOP “Windows Firewall/Internet Connection Sharing (ICS)”
NET STOP “Windows Management Instrumentation”
REM 1)If you’re getting the 0x80072ee2 error, reboot so that a previous install will finish. When it comes back up you’ll probably be getting the 0x8024400a error.
REM shutdown -r -t 60 -c “This computer needs to restart to fix error WARNING: Send failed with hr = 80072ee2 or WARNING: Send failed with hr = 80072ee2″
REM 2)Go to the command prompt. If you’re using Group Policy, do a gpupdate /force
REM gpupdate /force
REM 3)Make sure the automatic updates service is set to automatic for its startup
sc config “wuauserv” start= auto
REM 4)Stop the automatic updates service. Then start it.
REM 5)Go to the command prompt and type wuauclt.exe /resetauthorization /detectnow
REM 6)Look in the “WindowsUpdate.log” (not the “Windows Update.log” ) If the log says “Reporting Client Status” near the end of the log (check the date/time and compare it with the date/time you did step 5) and the WSUS server is still showing a status of “Not having checked in”, then be patient. Wait a few hours and it will change. If it hasn’t changed in a few hours, check your group policy and see when it’s next check-in time will be (the setting you set in group policy of when it obtains its updates is when it will next check in.)
REM 7)If the status of a client still hasn’t changed by its next check-in time, run the Microsoft Security Baseline Analyzer to force a check-in.
REM ##################################
REM ### END OF Send Failed
REM ##################################
REM ##################################
:EndOfSendFailed
ECHO END of section Send Failed
REM ##################################
REM ### END OF Send Failed
REM ##################################
REM ##################################
REM ####################################
REM ### Section SOAP ERRROR
REM ### Searching the log file for
REM ### the applicable errors
REM ### 1> WARNING: SOAP Fault: 0x00012c
REM ### 2> WARNING: GetCookie failure, error = 0x8024400D, soap client error = 7, soap error code = 300, HTTP status code = 200
REM ####################################
findstr /C:”WARNING: SOAP Fault: 0x00012c” %windir%\WindowsUpdate.log
If %ERRORLEVEL% EQU 0 Goto :FOUNDStringSoap
goto EndOfSoap
:FOUNDStringSoap
set isError=yes
set FIX=Soap-%fix%
ECHO Fix Found the String ‘WARNING: SOAP Fault: 0x00012c’
NET STOP “Dell ControlPoint Button Service”
NET STOP “Dell ControlPoint System Manager”
NET STOP “Smith Micro Connection Manager Service”
NET STOP “Intel(R) Matrix Storage Event Monitor”
NET STOP “Automatic Updates”
NET STOP “Background Intelligent Transfer Service”
NET STOP wuauserv
NET STOP “Windows Firewall/Internet Connection Sharing (ICS)”
NET STOP “Windows Management Instrumentation”
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\Policies\Microsoft\Windows\WindowsUpdate /f
REM section possibly causing other wmi problems.
REM RMDIR /S /Q %WINDIR%\System32\wbem\Repository
RMDIR /S /Q %windir%\SoftwareDistribution
rundll32 wbemupgd, UpgradeRepository
:EndOfSoap
ECHO END of section Soap
REM ##################################
REM ### END OF Soap
REM ##################################
REM ##################################
REM ##################################
REM ###
REM ### End of Script
REM ###
REM ##################################
REM ###################################
REM ### If there was an error, this resets the log file
REM ### So that the same error is not corrected again
REM ###################################
if /I %isError%==yes (goto MoveLogFiles)
goto EndOfScript
:MoveLogFiles
echo moved log
MOVE /Y %windir%\WindowsUpdate.log %windir%\WindowsUpdate.old.log
ECHO %date% %time% %FIX% >> %windir%\WindowsUpdate.old.log
REM ###################################
REM ### Restarting Services
REM ###################################
:EndOfScript
sc config “wuauserv” start= auto
ECHO Starting Automatic Updates
NET START “Automatic Updates”
ECHO Starting BITS
NET START “Background Intelligent Transfer Service”
ECHO Starting wuauserv
NET START wuauserv
ECHO Starting Windows Firewall/Internet Connection Sharing(ICS)
NET START “Windows Firewall/Internet Connection Sharing (ICS)”
ECHO Starting Dell addon services. No need to sweat if these do not start.
NET START “Dell ControlPoint Button Service”
NET START “Dell ControlPoint System Manager”
NET START “Smith Micro Connection Manager Service”
ECHO Starting Windows management Instrumentation
NET START “Windows Management Instrumentation”
ECHO forcing wuauclt to resetauthroization and /detectnow
if /I %isError%==yes (wuauclt /resetauthorization /detectnow)
if /I %isError%==no (wuauclt /detectnow)
NET START “Vision Control Manager”
ECHO %DATE% – %TIME% – End GPO WSUS_fix.bat >> %WINDIR%\TEMP\GPO.StartupScript_GPO WSUS_fix.bat.log
EVENTCREATE /SO “GPO WSUSfix.bat End” /T INFORMATION /ID 2 /L SYSTEM /D “This is a GPO start up script. A Begin entry should follow by an End entry. If not, you may have a hanging Script.”
END SCRIPT
I must add that if this script hangs, it is most likely due to a NET STOP command that is stopping a service that has other services that depend on it. It then will sit there waiting for you to hit the Y key. You can log into the computer and manually execute the NET STOP commands one at a time to find out what services are causing the hanging. If you find one, you should add a comment and include this service. You’ll notice some services like “Vision Control Manager” may not exist in your environment. Having extra non-existant services stopped shouldn’t cause any problems.
I have seen a few clients that had multiple problems and it required this start up script to be ran a few times before the computer was in the WSUS console and was getting its updates.
Here is another script I found, it could also be included as a fix script.
%Windir%\system32\net.exe stop bits
%Windir%\system32\net.exe stop wuauservreg 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 /fif 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.dlldel C:\Windows\WindowsUpdate.log /S /Q
rd /s /q %windir%\softwareDistribution
sleep 5
%Windir%\system32\net.exe start bits
%Windir%\system32\net.exe start wuauservsc 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 /reportnowexit /B 0

Thank you very much to share this information. It is very useful and informative.
mlm software