# Inventory Scan failure - WMI Service is Down / Disabled ## Problem You are unable to proceed with manual / scheduled Inventory Scanning and you get an error **"WMI Connection Failed" / "Asset Scan Locked"** during the process. ## Cause **Note:** If you encounter the error message **"Asset Scan is Locked,"** it indicates that `dcinventory.exe` has likely crashed. Please reach out to [support](mailto:endpointcentral-support@manageengine.com) for further assistance. You will encounter this error due to one or more of the following reasons: - Client machine is too slow due to reasons like high CPU/Memory utilization. - WMI is not configured properly. - WMI repository corrupted. - WMI Service Disabled ## Resolution 1. [To check if WMI Service is running](#to-check-if-wmi-service-is-running) 2. [To check if WMI Repository is corrupted](#to-check-if-wmi-repository-is-corrupted) 3. [To perform a repair/re-sync of the WMI repository](#to-perform-a-repairre-sync-of-the-wmi-repository) 4. [To rebuild your WMI repository](#to-rebuild-your-wmi-repository-follow-the-below-steps) ### To check if WMI Service is running: - Open **Services** and check the **Windows Management Instrumentation** status is **Running** and startup type is **Automatic**. ### To check if WMI Repository is corrupted: - Run: ``` wbemtest ``` ![WMI repository is corrupted step 1](https://www.manageengine.com/products/desktop-central/images/wmi1.png) - Connect to namespace **root\cimV2** ![WMI repository is corrupted step 2](https://www.manageengine.com/products/desktop-central/images/wmi2.png) - Select **Query** and enter: ``` Select * from Win32_operatingsystem ``` ![WMI repository is corrupted step 3](https://www.manageengine.com/products/desktop-central/images/wmi3.png) - The above image depicts a healthy WMI repository. - In case an error occurs in `wbemtest`, then rebuild / repair / resync the WMI repository. ### To perform a repair/re-sync of the WMI repository Run the following commands in **Command Prompt as administrator** on the machine being monitored: **For Windows XP and Windows 2000 Servers:** - To clear the WMI performance counter settings: ``` winmgmt /clearadap ``` - To stop the WMI Service: ``` winmgmt /kill ``` - To unregister the WMI service: ``` winmgmt /unregserver ``` - To register the WMI service: ``` winmgmt /regserver ``` - To re-synchronize performance counters: ``` winmgmt /resyncperf ``` **For Windows 2003 Servers:** - To recompile all MOF files: ``` wmiadap.exe /c ``` - To reload the performance library and rebuild the performance counters: ``` wmiadap.exe /f ``` - To reload all performance counters and their settings from the Windows registry: ``` lodctr /R ``` - For Windows 7 and later versions, and Windows Server 2008: ``` winmgmt /salvagerepository ``` ### To rebuild your WMI repository follow the below steps - Open **Services**, locate the **Windows Management Instrumentation** service. Set the Startup Type to **Disabled** and **Stop** the service. - Remove or rename the **Repository** folder from the path: ``` C:\Windows\System32\wbem\ ``` - Once you have removed or renamed the Repository folder, set the Startup Type as **Enable** and **Start** the **Windows Management Instrumentation** service. - Open **Command Prompt as Administrator** and execute the following commands: 1. ``` cd C:\Windows\System32\wbem\ ``` 2. ``` for /f %s in ('dir /b *.mof') do mofcomp %s ``` Kindly note that the above command will take a minute or so to complete. Once completed proceed with the below command. 3. ``` for /f %s in ('dir /b en-us\*.mfl') do mofcomp en-us\%s ``` - Open Performance Monitor to verify that all counters can be loaded. **Note:** If you encounter an error in Performance Monitor, refer to the [Microsoft KB](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/manually-rebuild-performance-counters) document for assistance. ## Verification After completing all the steps, verify if the WMI service is running in Services. - If the service is running, change the startup type to **Automatic**. - Restart the WMI service to proceed with asset scan. If the above settings are already configured: - Press **Windows + R** to open the Run dialog and enter: ``` wbemtest ``` - Click **Connect** and select **Query**. - Execute the query: ``` Select * from Win32_operatingsystem ``` - If this works, resume your inventory scan operation.