Reset Windows Update Agent

This Script allow reset the Windows Update Agent resolving issues with Windows Update.

ResetWUEng.zip
 
 
 
 
 
4.5 Star
(184)
564,158 times
Add to favorites
Windows Update
5/17/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Fix corrupted registry.pol?
    4 Posts | Last post Sat 12:35 PM
    • A corrupted registry.pol will prevent gpos from applying and software updates from installing via SCCM. It usually corrupts due to missing AV exclusions. I have a script that will detect if it's corrupt or not and delete it if so if you're interested in it?
    • Hi Russ,
      
      Of course! this tool is built for the users. Any contribution is well received.
      
      Thank so much!
    • If it's corrupted, it's always full of NULLs/whitespace.  If it's not corrupt, the byte encoded value of the first 4 lines of it will always equal a value of 8082101103. When it's corrupt, there's always a -2147467259 or 0x80004005 in wuahandler.log if using SCCM. There should be various GPO failures in the eventlogs as well when it's broke.
      
      Function Test-IsRegistryPOLGood
          {
              [cmdletbinding()]
              Param
                  (
                      [Parameter(Mandatory=$false)]
                          [string[]]$PathToRegistryPOLFile = $(Join-Path $env:windir 'System32\GroupPolicy\Machine\Registry.pol')
                  )
       
              if(!(Test-Path -Path $PathToRegistryPOLFile -PathType Leaf)) { return $null }
       
              [Byte[]]$FileHeader = Get-Content -Encoding Byte -Path $PathToRegistryPOLFile -TotalCount 4
       
              if(($FileHeader -join '') -eq '8082101103') { return 'Compliant' } else { return 'Not-Compliant' }
          }
      
      Test-IsRegistryPOLGood
    • I'm sorry for being late.
      
      I'll try implement this PowerShell script in my Windows Shell Script.
      
      Thank you so much.
  • I have translated the last version into German
    4 Posts | Last post May 16, 2019
    • How i can send it to you for distribution.
      you can find it here: 
      https://1drv.ms/u/s!Ahekt4Y668a52ctnTz-Cq0bj47U1ug?e=zxIkgT
      
      The only additional text is bei comment in the TOP stating the translation by me.
    • Hi Alexander Jacubowsky (AJEDV),
      
      Do you agree that I created a post on TechNet and publish it on wureset.com for distribution? Obviously, the credits to your name will be kept.
    • Sure, that's what I expected.
      Thank you.
    • It's done!
      
      Skript Reset Windows Update Tool (Deutsch) - https://gallery.technet.microsoft.com/scriptcenter/Skript-Reset-Windows-db19560e
      
      Thanks!
  • Run script silently
    2 Posts | Last post May 03, 2019
    • Is it possible to run the command line tool remotely from something like PDQ deploy without any user prompts and run the command line tool silently in the background.
      
      Love the tool, but would be awesome if i could run the commands without any user intervention.
    • Thanks philly169,
      
      It's possible with the executable version.
      
      You can create a self-extracting file with WinRAR for run in background.
      
      For example:
      
      ```SFX
      Setup=wureset.exe /reset
      TempMode
      Silent=1
      Overwrite=1
      ```
      
      Also, you can run this tool automatically using Windows Task Scheduler or Regedit.
      
      Download the executable version in https://wureset.com/downloads.php and see more about command line arguments in http://docs.wureset.com in the section `Getting started` > `command line`.
  • Run this for multiple machines?
    2 Posts | Last post April 29, 2019
    • Is it possible to batch run this for multiple machines? 
    • Hi Shadowz1337,
      
      This tool has changed a lot and the installable or portable version allows to execute commands from cmd.
      
      You can download this in https://wureset.com/downloads.php or see more in http://docs.wureset.com in the section `Getting started` > `command line`.
      
      
  • Thank's a lot Manuel
    2 Posts | Last post April 26, 2019
    • Your tool is awesome and saved my installation several times!
    • I'm happy to read your comment. Thanks!
  • Thanks Manuel F. Gil
    2 Posts | Last post April 21, 2019
  • Does it reset SusClientID?
    3 Posts | Last post April 15, 2019
    • Hi Manuel
      great job, your solution fix my tons of clients that report uncorrect version and/or uncorrect date of contact in wsus.
      Does "Resets the Windows Update Components" recreate the SusClientID?
      When you clone a lot of pc you have to reset SusClientID otherwise on wsus console all look like the same record.
      Before your cmd, sometimes (not often) i recreated SusClientID and it also fixed wsus agent problem.
      Thanks
      https://blogs.technet.microsoft.com/sus/2009/05/05/resolving-the-duplicate-susclientid-issue-or-why-dont-all-my-clients-show-up-in-the-wsus-console/
    • Thank you Luca,
      
      The reset SusClientID option it's distributed in several options:
      
      * Deletes any incorrect registry values. This option removes some Windows Update registry keys such as the following: SusClientId, SusClientIdValidation, PingID, AccountDomainSid.
      
      * Searches Windows updates. This option runs the command to force a check-in to the WSUS server: wuauclt /resetauthorization /detectnow command
      
      I recommend the following sequence to reset SusClientID: Deletes any incorrect registry values, Resets the Windows Update Components And Searches Windows updates.
      
      I hope this is helpful to you.
      
      
    • Hi Luca,
      
      Due to the need for a tool that can perform this task, I have created a small script for it:
      
      https://gallery.technet.microsoft.com/scriptcenter/Reset-WSUS-Client-ID-90661da1
      
  • Very niche
    2 Posts | Last post April 15, 2019
  • Command Line Switches
    4 Posts | Last post March 07, 2019
    • Hello Manuel!!! Let me start with how awesome your tool is. I've been able to fix countless Windows Update errors thanks to it.
      
      Writing to confirm if there's a bug or if I'm simply not using the WUReset script correctly. 
      
      Trying to get it to run via command line. So, opening my prompt via Run as Admin, typing "resetWUEng.bat /reset /clean:temp" or "resetWUEng.bat WURESET /reset /clean:temp" Both cases, the script launches, and I'm presented with the Terms and Conditions of Use. How can I skip this? is there an hidden parameter I'm missing?
    • Hi Stephane.Faubert,
      
      Thank for your comments.
      
      Apparently there is a misunderstanding, since the commands mentioned are used with the executable version(WURESET.exe).
      
      The execuable version contains some additional features, but in general, it fulfills the same functions as this version
      
      Please, download it on wureset.com/downloads.php and try again.
      
      I hope this is helpful to you.
      
    • Ohhhhh!!! That explains why :) Ok I will try it out. Thanks a bunch!
    • Here is the list of options:
      
      Open System Properties.
      Reset the Windows Update Components.
      Delete temporary files in Windows.
      Open Internet Explorer options.
      Run Chkdsk on the partition Windows is installed on.
      Run the System File Checker tool.
      Scan the image for component store corruption.
      Check the image for corruption or other issues.
      Perform repair operations automatically.
      Clean up superseeded components.
      Delete incorrect Registry values.
      Repair / Reset Winsock.
      Force Group Policy Update.
      Search for Windows Updates.
      Explorer other local solutions.
      Explorer other online solutions.
      Download Diagnostic Tools.
      Restart the PC.
      While it is clear automatically what some options do, e.g. Open System Properties, it may not be clear what others such as "Delete incorrect Registry values" do.
      
      The only option to find out is to open the script in a plain text editor and check the relevant parts of it to see what it does.
      
      The temporary file cleaning part for instance uses the two commands del /s /f /q "%TEMP%\*.*" and
      del /s /f /q "%SYSTEMROOT%\Temp\*.*" to remove files from system temp folders.
      
      Some operations run lots of commands. If you select to reset Windows Update components, a series of commands is executed that include stopping services, killing tasks, deleting files, registering files again and more.
  • In the script - a path and a file do not exist - amended script used successfully
    8 Posts | Last post February 23, 2019
    • I have tested an amended form of the script. It now does what I expected it to do. I suggest amending the script to include the additional line 
      del /s /q /f "%ALLUSERSPROFILE%\Microsoft\Network\Downloader\qmgr*.dat"
      
      I cannot know how many users have this alternative qmgr location. All I know is that both mine do & neither of them has the qmgr location given in the original script. I clean installed Windows 10 on both computers during August.
      
       At the risk of boring you:-
      1 I thought something needed to be investigated because, after running the original script then manually running Settings, Updates it searched for updates even though it was not connected to the internet or to any other computers and produced results [a list of updates to be downloaded - those that had been found during a previous update search]. So I concluded that the previous update queue had not been cleaned out by the batch file.
       2 After running an amended script that deleted the qmgr files in the alternative location, running Settings, Updates resulted in an almost immediate response that it couldn't connect to the update services [no list of updates was displayed]. This new behaviour makes sense because the computer was still not connected to the internet or any other computers.
      So, the amended script successfully reset Windows update, including the update queue, whereas the original batch file did not.
      
       The subject is of particular significance to me because I use a metered internet connection and I sometimes run Windows update to see if there is anything large enough to warrant going to the free & fast WiFi in my local library. I need to reset the update queue so that I can run Windows update from a clean start - otherwise it would continue with the existing list of updates and only afterwards would it bother to search for new ones [new ones that might supercede those just installed].
      
      Denis
    • Denis, 
      
      I just checked my Surface Book Win 10 (fully updated as of Oct 11) and it has both of the locations you showed for the qmgr files. Apparently they are aliases, deleting from either location deletes from the other as well. (Just one data point, I have no idea how any other version might work.) 
      
      I totally identify with your metered connection woes. I often go for two weeks or more without being able to update. Despite keeping the wuauserv service disabled at home, I just found two qmgr files stacked up. It does seem like it takes multiple reboots before it will actually start updating when I do get to a real connection. Maybe deleting the qmgr files would help that? 
      
      Loren
    • Loren,
      
      Yes, some others have also reported that they have both locations.  I have not seen any explanation for the differences but they might be because I recently clean re-installed.  
      
      TenForums have now amended their script to include both locations so that everybody is catered for, see Windows Update - Reset in Windows 10 [http://www.tenforums.com/tutorials/24742-windows-update-reset-windows-10-a.html].
      
      I use a different approach to managing updates.
      - See the MSA article Manage data usage and Windows updates in Windows 10 - WiKi [http://answers.microsoft.com/en-us/windows/wiki/windows_10-networking/manage-internet-data-usage-and-windows-updates-in/5417b89b-4790-4cd9-b854-809862274447]
      - By basing the update control on the connection's metered property rather than disabling Windows update, rebooting is avoided completely for WiFi connections & is limited to a single reboot {upon removing the metered property} for Ethernet connections.
      - If you have any questions about using the metered property then start a question in the MSA website & post a link to it in that article or post it here.
      
      Denis
      
    • Denis,
      
      Wow - great post on "metered" updates! I do have my expensive local connections set to metered, and it does help. But when I get to my city Wi-Fi, I almost always have to restart before "automatic" updates will even do the first check, and then several more times to work through each different batch of updates. And too often one of them just hangs up forever. 
      
      Lately I've been using the MichalGajda PowerShell script for updates: 
      
      https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/
      
      It seems to have some curiosities I don't fully understand yet, or maybe the Windows Update components it uses find the same problems there they do in "automatic" mode, but at least in PowerShell I get feedback about what is happening and can take action immediately instead of restarting and just waiting...  
      
      https://social.technet.microsoft.com/Forums/windows/en-US/5c6c1cf6-1494-4140-87da-caea1f42608c/microsoft-driver-update-for-hp-deskjet-895cse-locks-up-windows-update-unless-manually-hidden?forum=win10itprosetup&prof=required
      
      (Latest info at the "this gets more complex..." section)
      
      As for disabling the update service, I believe I'm getting your "the CPU usage suddenly leapt up to almost 100% and stayed there for days" if I leave it running. Actually the "Update Orchestrator Service" is even more likely to trigger CPU overload here, I keep them both disabled. For me it happens much sooner than a month after successful updates. 
      
      Will be interesting to see if the "Reset Windows Update Agent" script has changed any of this. It apparently did reset my Wi-Fi to non-metered...  The cleanup function got rid of several GB of old junk, so running it was worth it just for that! 
      
      Loren
      
    • Loren,
      
      I am concerned that out discussion is off-topic here and therefore disconcerting for others monitoring this thread.  If you want to continue then please raise a question in the MSA forum & post a link to your question here or in a Comment to the Wiki article there.
      
      There is no need to 'restart before "automatic" updates ...' because update can simply be run manually despite the metered setting.
      
      You should not be getting "batches" of updates in Windows 10.  It is possible for a second run to be needed but I have never seen any more than that.
      
      There have been several reports of repeatedly failing printer driver updates [not all of them HP ones].  Since you can go to HP directly to get their latest software for your printer, I would suggest turning off all hardware updates using the advice in the Wiki article.  Before you go to HP to see if they have any updated software, please consider their recently-reported drive to block the use of non-HP printer cartridges in their products  http://www.bbc.co.uk/news/technology-37408173 [My HP printer is two years old so I am not going to bother updating its software any more]
      
      I tested the reset Windows update components script from TenForums [modified for the additional qmgr location] on a computer with a metered ethernet connection and a computer with a WiFi connection.  Neither one had its metered property altered so I am baffled by your comment about that.  The TenForums script is based on the one from this TechNet thread - I have looked through this version as well but cannot see anything that would reset a metered property.  You would normally only find it has reset if the network driver has been reinstalled, the network has been forgotten or a Windows update has reset it.
      
      I have not seen the Powershell method before.  I'll have a look at it soon.
      
      Denis
    • Hi Denis and Loren,
      
      Thanks for write. I've been busy and I have not had enough time to investigate about this issue, however, thanks to your contribution I have added the new location in this tool to others with the same problem can find a solution.
      
      The process of developing a tool like this is quite long and although Microsoft is updating its content constantly, sometimes is not enough.
      
      I am very grateful for your collaboration to this tool.
      
      Manuel Gil.
    • My pleasure entirely.  Denis
    • also works on 2008 R2 server -even though it detects as Win 7 :-)
      thanks for a great little tool.
1 - 10 of 78 Items