PowerShell · Intune · Windows Autopatch
WindowsAutopatchFix
Intelligent detection and repair of Windows update issues as an Intune Proactive Remediation. It only performs what is actually broken – no unnecessary system changes.
What it does
The script consists of two parts: detection.ps1 checks whether Windows update issues are present,
and remediation.ps1 fixes them precisely. 15 independently configurable remediation steps are only executed when required.
Features
- Smart Detection – DLL version checks, BitLocker status, service dependencies, error code dictionary (20+ codes)
- 15 configurable remediation steps – registry cleanup, DLL re-registration, WSUS artifact cleanup, autopatch checks, and more
- Service retry logic – 3 attempts with exponential backoff (500 ms → 1 s → 2 s)
- Auto log rotation – 10 MB limit, last 5 logs retained
- Supported error codes:
0x80070002,0x80240034,0x800F0922,0xC1900200and more
Deployment in Intune
Devices → Scripts and remediations → Proactive remediations → + Create
Detection: detection.ps1 | Remediation: remediation.ps1
Run as: System | 64-bit PowerShell: Yes | Schedule: Daily
Files
detection.ps1(v2.2) – Diagnosis with BitLocker check, DLL validation, network tests; Exit 0 = OK, Exit 1 = repair requiredremediation.ps1(v3.3) – intelligent repair with 15 configurable stepsTest-WindowsUpdateFix.ps1– local test script before Intune deployment
Requirements
Windows 10/11 · Microsoft Intune · PowerShell 5.1+ · System/admin permissions