From 10947d58b8a9fed565afb5e3977c435e6d880617 Mon Sep 17 00:00:00 2001 From: Ryan Malayter Date: Thu, 17 Jul 2025 16:12:41 -0500 Subject: [PATCH] Update ResetWindowsUpdateRemediation.ps1 add removal of qmgr*.dat files 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 --- ResetWindowsUpdateRemediation.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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