Use the least-destructive approach first, and avoid deleting or rebuilding the repository as a first step. Microsoft explicitly warns that deleting or rebuilding the WMI repository can damage the system or installed applications, and rebuilding resets WMI to its initial OS-install state.
A silent repair script can follow this sequence from an elevated command prompt or startup script:
- Verify repository consistency:
winmgmt /verifyrepository
- If WMI-related errors persist, re-register WMI provider DLLs and recompile MOF files:
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
sc config winmgmt start= Auto
net start winmgmt
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %%s in (moflist.txt) do mofcomp %%s
Notes:
- Run it elevated.
- This restarts the WMI service.
-
regsvr32 /s runs silently.
- Recompiling MOF files restores built-in providers in the default path.
For the specific GPO WMI filter startup issue, also check whether the filter itself is inefficient. A documented cause of slow or failed evaluation is a broad query such as:
Select * from Win32_NTDomain where ClientSiteName = "XYZ"
A more targeted query is:
Select * from Win32_NTDomain where DomainName = "Domain_name" AND ClientSiteName = "XYZ"
This can reduce timeout-related Event ID 1085 scenarios when the repository is not the only problem.
If the affected systems are Windows Server 2008 R2 SP1, Microsoft also documents a related hotfix requirement for GPO WMI filter issues.
References: