Challenge
Veeam Endpoint Backup UI crashes with error “WMI method call failed”The follwing log file C:\Program Files\Veeam\Endpoint\UI.Tray.user name.log contains these error messages:
Error Error occured while calling to WMI. Query: [SELECT LastBootUpTime FROM Win32_OperatingSystem WHERE Primary='true']. Error Dispatch thread will be restarted: fault detected. Waiting [5 sec]. [Error Invalid class (System.Management.ManagementException)
Cause
The WMI repository is corruptedSolution
Open the command line as administrator and runwinmgmt /verifyrepository
If the output report inconsistency (WMI repository is inconsistent), follow the steps below.
You will need to re-register all of the dlls and recompile the .mofs in the wbem folder and re-registering WMI Service and Provider. You can use the following script by saving to txt file. You can rename it to .bat and run it from command prompt with administrator rights and change focus to following directory: C:\Windows\System32\Wbem.
echo off
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
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s
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
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s
After running the script, reboot the machine and re-run winmgmt /verifyrepository.
More Information
IMPORTANT: Deleting and rebuilding the WMI repository can damage the system or the installed applications.If you choose to re-create the WMI repository, you will be doing so at your own risk.
In case the method above does not resolve the issue, check the solution described here.