Reset-WindowsUpdate.ps1

This script will completely reset the Windows Update client settings. It has been tested on Windows 7, 8, 10, and Server 2012 R2. It will configure the services and registry keys related to Windows Update for default settings. It will also clean up files related to Windows Upda

 
 
 
 
 
4.6 Star
(50)
372,355 times
Add to favorites
Windows Update
11/13/2017
E-mail Twitter del.icio.us Digg Facebook
  • Some issues
    2 Posts | Last post February 06, 2020
    • Thanks for the script. I haven't used it but from looking at the code, I see a couple of problems.
      
      1. The script tries to re-install the Windows Update agent but it's using a hard-coded installation package for Windows 8. I am not sure if it is a good idea to re-install the Windows Update agent in any case but the documentation does not state where it expects the MSU file and for any other OS version than Windows 8, it would not work anyway.
      
      2. The check for 64-bit OS version does not work. The condition in line 104 should be like this:
      
      if($arch.AddressWidth -eq 64)
      
      but I would suggest to use 
      
      if([System.Environment]::Is64BitOperatingSystem)
      
      This works in PowerShell Core, too.
      
      3. The script deletes %SystemRoot%\WindowsUpdate.log. On Windows 10/Windows Server 2016 and higher the file should NOT be deleted. So better check for it:
      
      if([System.Environment]::OSVersion.Version.Major -lt 10){Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue}
      
      4. It deletes all BITS jobs while the BITS service is not running. Haven't tested it but I would be surprised if this would be working.
      
      5. It deletes all BITS jobs for the current user only. Existing BITS jobs of the Windows Update agent will run under LocalSystem. So you need to specify the -AllUsers switch (and maybe better for PS Core compability to stick to bitsadmin.exe).
      
      Get-BitsTransfer -AllUsers | Remove-BitsTransfer
      
    • Thanks For this idea I think it's agood one 
  • Good work
    1 Posts | Last post October 23, 2019
    • I wrote a very similar script but it didn't always work. Good idea re-registering the dll's!
  • One issue with this script
    1 Posts | Last post October 23, 2019
    • Thank you for this by the way. I am trying to run this on a 1607 machine that is kicking an update error. I ran this the first time and got an error that I could not stop the Stop-Service -Name cryptsvc process without a force. Added a force and it ran without error. Just wanted to let you know.
      
      Thanks again!
  • how to run/install it in win 10 inspiron build 18990
    1 Posts | Last post October 20, 2019
    • As i faced this issue earlier too in some earlier build for which i have to do some steps from internet ,then once svchost.exe done some updates and its fine .
      but now i already tried all steps but facing same prblm and most dissapointng windows stops giving support via remote assitance.
      >>whatever plz mention whether run it via batch file or any cmd command
      
  • Reset-WindowsUpdate.ps1
    1 Posts | Last post October 19, 2019
    • I downloaded it. How do I run it?
  • Test by terry
    1 Posts | Last post October 08, 2019
    • test in 10
  • Test by terry
    1 Posts | Last post October 08, 2019
  • How exactly do I execute the downloaded PS1 file?
    1 Posts | Last post October 07, 2019
    • Now that I've downloaded the PS1 file, how do I run it?
  • will running this script initiate a reboot ?
    1 Posts | Last post July 08, 2019
    • running server 2012 r2, windows update is not working , spinning forever, will this script reboot the server?
  • Reset-WindowsUpdate.ps1 does not work
    1 Posts | Last post July 07, 2019
    • Reset-WindowsUpdate.ps1 does not work. Any ideas please?
      Thanks.
1 - 10 of 24 Items