WMI Repository Fix

WMI seems to be used quite widely in the C# community whether it be for retrieving computer hardware information, running proccess. There is a huge list of information that you can query.

Recently I have been working on a client service which gathers computer information and enters it into a SQL database. However after rolling this client out onto a pilot group of machines i found that not all of them were reporting any information.

It looked to me as if the WMI repository on these machines was corrupt. There seem to be a few fixes (details below) out there and I have tried them without a consistent result.

So what do I do? The answer if possible is to try and write my own C# class to fix wmi and include it in the client service which unpon start will check if WMI is responding and if not will try and fix it. So far i have tried wrapping some of these other fixes within a C# class but again was getting inconsist results (i.e. After running one of these fixes on a machine WMI started to respond to some queries but not all).

I will endevour to find a solution to this issue and when i have come up with something concrete I will add an update here or in another post..