Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ResetWindowsUpdateRemediation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -35,4 +41,4 @@ Start-Service -Name wuauserv
if ($DependentService) {Start-Service $DependentService}

wuauclt /updatenow
Exit 0
Exit 0