diff --git a/ResetWindowsUpdateRemediation.ps1 b/ResetWindowsUpdateRemediation.ps1 index 3dbb26b..cb20d03 100644 --- a/ResetWindowsUpdateRemediation.ps1 +++ b/ResetWindowsUpdateRemediation.ps1 @@ -3,7 +3,8 @@ Version: 1.0 Author: - JOrgen Nilsson (ccmexec.com) Script: ResetWindowsUpdateRemediation.ps1 -Description: +Description: reset windows update services based on Microsoft guidance at + https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/additional-resources-for-windows-update#how-do-i-reset-windows-update-components Hint: This is a community script. There is no guarantee for this. Please check thoroughly before running. Version 1.0: Init Run as: Admin @@ -15,6 +16,11 @@ Stop-Service -Name wuauserv Stop-Service -Name cryptsvc -Force Stop-Service -Name bits -Force +#delete qmgr*.dat files based on Micorosft guidance +if (Test-Path "$env:ALLUSERSPROFILE\Microsoft\Network\Downloader\qmgr*.dat") { + Remove-Item "$env:ALLUSERSPROFILE\Microsoft\Network\Downloader\qmgr*.dat" -Force +} + if (Test-Path $Env:Windir\SoftwareDistribution.bak) { Remove-Item $Env:Windir\SoftwareDistribution.bak -Recurse -Force Rename-Item -Path $Env:Windir\SoftwareDistribution -NewName SoftwareDistribution.bak @@ -35,4 +41,4 @@ Start-Service -Name wuauserv if ($DependentService) {Start-Service $DependentService} wuauclt /updatenow -Exit 0 \ No newline at end of file +Exit 0