WMI (Windows Management Instrumentation) Repository เก็บข้อมูลเมตาของคลาส WMI หากเสียหายจะทำให้เกิด Provider Load Failure บทความนี้แนะนำวิธีตรวจสอบและซ่อมแซม WMI Repository
ตรวจสอบความเสียหายของ WMI Repository
รันคำสั่งใน Command Prompt (Admin):
winmgmt /verifyrepository
- แสดง repository is consistent = ปกติ
- แสดง repository is not consistent = เสียหาย ต้องซ่อมแซม
วิธีซ่อมแซม WMI Repository
1. รีเซ็ต WMI Repository ด้วยคำสั่ง
winmgmt /salvagerepository- ตรวจสอบและสร้างใหม่หากพบความไม่สอดคล้องwinmgmt /verifyrepository- ตรวจสอบอีกครั้ง- หากยังไม่สอดคล้อง ให้รัน
winmgmt /resetrepository- รีเซ็ตกลับสู่สถานะตอนติดตั้ง Windows ครั้งแรก
2. Force Recovery WMI
WMI มีกระบวนการ AutoRestore (ใช้ VSS backup) และ AutoRecovery (สร้างใหม่จาก MOF ที่ลงทะเบียน)
ตรวจสอบคีย์ Registry: HKLM\Software\Microsoft\WBEM\CIMOM\Autorecover MOFs
หากว่าง ให้คัดลอกค่าจากเครื่องอื่นที่เหมือนกัน แล้วรัน winmgmt /resetrepository
หากเจอข้อผิดพลาด 0x8007041B ให้หยุดบริการที่ขึ้นอยู่กับ WMI ก่อน:
net stop winmgmt /y winmgmt /resetrepository
3. ใช้ WMI Fixer Tool
เครื่องมือจาก Microsoft Technet (ปัจจุบันดาวน์โหลด PowerShell version จาก GitHub) สำหรับซ่อมแซม WMI Repository อัตโนมัติ
อาการ WMI เสียหาย
- ไม่เชื่อมต่อ root/cimv2 namespaces ได้ (Error 0x80041002)
- Computer Management แสดง "WMI: Not Found" หรือค้าง
- Error 0x80041010 WBEM_E_INVALID_CLASS
- wbemtest ค้าง
- Schemas/Objects หายไป