# OLE Dispatch Exception Code 0 SWbemObjectSet: Invalid Class

You can receive error **0x80041010** from multiple applications that call WMI. For my example it was received in Computerlink while checking for the port server process.

![OLE Dispatch Exception.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/ole-dispatch-exception.png)

This can be triggered by running the **systeminfo** command in a command prompt or applying patches in SCCM.

No matter where you got the error the underlying issue is probably with WMI. Here is how to check!

### Confirm WMI is Broken:

Launch the WMI MMC snapin by clicking **Start -&gt; Run** then enter **wmimgmt.msc**

Right click **WMI Control (Local)** and click **Properties**

![WMI Control Local.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/wmi-control-local.png)

If WMI is working properly then it will show the system information. If you see **Invalid class** then your WMI is not working correctly.

<table border="1" id="bkmrk-invalid-good" style="border-collapse: collapse; width: 100%; border-width: 0px; border-style: hidden;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td style="border-width: 0px;">[![WMI Control Invalid.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/wmi-control-invalid.png)](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/wmi-control-invalid.png)

**Invalid**

</td><td style="border-width: 0px;">[![WMI Control Good.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/wmi-control-good.png)](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/wmi-control-good.png)

**Good**

</td></tr></tbody></table>

### The most likely cause is MOF Registration Errors

To resolve MOF Registration errors the following command needs to be ran from an **elevated** command prompt. It will reregister all .MOF files with WMI.

```bash
CD C:\Windows\System32\WBEM dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s
```

Here is what the command looks like while it runs:

[![MOF Registration.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/mof-registration.png)](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/mof-registration.png)

Once finished check wmimgmt.msc to see if it is populating the Properties correctly.

[![WMI Control Good.png](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/scaled-1680-/wmi-control-good.png)](https://docs.computerlink.com.au/uploads/images/gallery/2023-06/wmi-control-good.png)