Recently I have found myself in a position where I have needed to reset WMI to resolve various problems such as SCCM client failing to install/detect and disappearing cluster namespaces. Generally resetting the WMI is a last resort and should only be tried when you have tried all other options. e.g. restart WMI service, restart server.
The command to reset the WMI repository must be run in an admin / elevated command prompt:
However sometimes this fails with this error:
WMI repository reset failed
Error code: 0x8007041B
Description: A stop control has been sent to a service that other running services are dependent on.
While it is possible to work around this by stopping the dependent services manually or even editing the registry so that nothing is dependent on this (as I have seen suggested else where) there is a much easier solution.
1. Launch an elevated (admin) powershell window.
2. Enter the following command.
Stop-Service winmgmt -Force; winmgmt /resetrepository
3. Restart the computer you just reset the WMI repository on.