How to Repair WMI

From Q
Jump to navigation Jump to search

When Q starts, it talks to the Windows Management Instrumentation service (WMI). This is a core part of Windows that lets third-party programs query information about your computer's hardware. Q uses this as part of its licensing scheme.

WMI is unfortunately quite fragile and may break as a result of:

  • system upgrades
  • running out of hard disk space
  • memory or other hardware problems

Diagnosing WMI Problems

Open a command prompt (see how-to), and enter the following commands, pressing Enter after each one:

wmic path win32_physicalmemory get capacity
wmic path win32_physicalmedia get serialnumber
wmic nic get MACAddress, PNPDeviceID

You should see results like the following:

C:\Users\Q>wmic path win32_physicalmemory get capacity
Capacity
4294967296
4294967296

C:\Users\Q>wmic path win32_physicalmedia get serialnumber
SerialNumber
E2AB1Z8O
30026A724406875B
Z1IK30DPKAEZ

C:\Users\Q>wmic nic get MACAddress, PNPDeviceID
MACAddress         PNPDeviceID
                   ROOT\KDNIC\0000
01:00:87:00:F3:18  ROOT\NET\0000
14:BA:E3:11:8B:AE  PCI\VEN_10EC&DEV_8198&SUBSYS_84321943&REV_06\4&1D7623B1&0&00E2

If you see this error message, please follow the steps in Allowing Permission for WMI Queries below:

ERROR:
Description = Access denied

If you see any other error message, for any of the commands, you need to repair the WMI repository. Follow the steps in the next section.

Repairing the WMI Repository

The following steps have been taken from a Microsoft guide on repairing the WMI repository that has been tested by Q support and worked on a Windows 10 machine whose repository was corrupted by memory problems.

  1. Launch the Command Prompt as an Administrator by searching for Command Prompt, then right-clicking on it and selecting Run as administrator:
    CommandPromptAsAdministrator.png
  2. Type this command and press Enter:
    winmgmt /verifyrepository
  3. Make a note of the error message you see. A good WMI repository will output the line WMI repository is consistent - if you see this specific message, then perhaps your WMI Repository is not corrupt, and instead you have a malfunctioning system device or device driver - please see the below section Troubleshooting or resetting your PC. Otherwise if you do see an error message, proceed with the next steps.
  4. Type this command (which will attempt to repair the WMI repository) and press Enter:
    winmgmt /salvagerepository
  5. Now type the verification command again and press Enter to see if it worked:
    winmgmt /verifyrepository
  6. If you see the message WMI repository is consistent then the repair worked. Otherwise, proceed with the next step.
  7. Type this command and press Enter:
    winmgmt /resetrepository
  8. You should see the message WMI Repository has been reset. If you see an error message instead, make a note of it.
  9. Reboot your computer, and then open the Command Prompt again and run the verification command again, like at step 2.

Once you have tried these steps, try the diagnosis commands again under the heading Diagnosing WMI Problems. If they work, you successfully repaired the WMI repository.

Troubleshooting or resetting your PC

If the commands in Repairing the WMI Repository did not work and you still experience errors, one of the system devices in your computer may not be working properly or some of Windows' system files may be corrupt. Please try:

  1. Use the troubleshooter tools built into Windows: https://support.microsoft.com/en-us/windows/use-a-fix-it-tool-with-windows-10-cc3cb85b-91d7-7e56-8ce1-db50b4d18d0b
  2. Reset your PC: https://support.microsoft.com/en-gb/windows/recovery-options-in-windows-31ce2444-7de3-818c-d626-e3b5a3024da5#bkmk_reset_pc

Allowing Permission for WMI Queries

Your user account has been denied permission to query the WMI repository. Your IT administrator needs to perform the following steps to allow you to query the WMI repository.

Your IT administrator needs to perform the following on your PC.

  1. Run (Windows key + R) WMImgmt.msc
  2. Right-click on WMI Control (Local) and select Properties
  3. Go to the Security tab
  4. Select the Root node
  5. Click the Security button
  6. Click Advanced
  7. Click Add
  8. Click Select a principal, and then select the user (or group) that needs to access WMI and click OK.
  9. Set Type to Allow
    Screenshot of needed permissions for WMI queries
  10. Set Applies to to This namespace and subnamespaces
  11. Check Enable Account and Read Security.
  12. Ensure that the permissions match the screenshot shown on the right. Click OK
  13. You should now be back in the dialog with the title Advanced Security Settings for Root. Please note that any Deny permissions will take precedence over Allow permissions. So you will need to remove or edit any deny permissions:
  14. Look for any permission entries that show Deny in the Type column.
  15. Remove these permission entries or edit them so they do not apply to the user, or that the Enable Account and Read Security permissions are not denied.
  16. Click OK.
  17. Click OK on the Security for Root dialog.
  18. Click OK on the WWI Control (Local) Properties dialog.
  19. Log in to Windows as the user that needs to use Q.
  20. Run the WMI query commands in the Diagnosing WMI Problems section above to confirm permission is now allowed. If permission is still not allowed, you may have selected the wrong user/group in the earlier step (Select a principal) or a Deny permission may still be overriding the Allow permission (Deny takes precedence over Allow).