How to fix a WMIDiag error

Posted on 2008-11-03
Medium Priority
Last Modified: 2013-12-01
I am having a WMI issue with one workstation and after running WMIDiag several times I have been able to cleanup all but two remaining errors. I ran WMIDiag with the CheckConsistancy parameter that was supposed to "fix" any errors (thanks SP2) but it did not correct much of anything, I had to smack it with a hammer numerous times.  The remaining two errors are listed below in the snippet section.  I have no clue how to correct them.  I am looking for very specific steps to resolve this issue.
Thanks in advance
38401 20:08:11 (1) !! ERROR: WMI EXECQUERY operation errors reported: ..................................................................... 2 ERROR(S)!
38402 20:08:11 (0) ** - root/ccm/Policy/machine, 'Select * From CCM_PolicyAgent_Configuration' did not return any instance while AT LEAST 1 instance is expected.
38403 20:08:11 (0) ** - root/ccm, 'Select * From SMS_Authority' did not return any instance while AT LEAST 1 instance is expected.
38404 20:08:11 (0) **

Open in new window

Question by:conlin
  • 4
  • 3
LVL 51

Expert Comment

ID: 22882395
Run CCMCLEAN and remove the SMS agent cleanly.  Check the logs to ensure it is, in fact, cleanly removed.
Reinstall the SMS client (if you need it) or deploy it again from the SMS Site Server to that machine.


Author Comment

ID: 22900386
Thanks Netman66
Running CCMClean seems to have fixed WMI as WMIDiag now claims that WMI is working properly.  Unfortunately I now have a couple of new issues that I'm not sure how important they are.  This is definitely "not" my area of expertise.  Would you review the WMIDiag report attached and let me know what you think.
I certainly appreciate your assistance.
LVL 51

Expert Comment

ID: 22901279
Stick this in a CMD file somewhere on that server:

cd \windows\system32\wbem
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

Stop the WMI Service in Services.msc.

Run the script from an open CMD window so you can see any errors.  Alternately, you can pipe the output to a file like so:

fixwmi.cmd > c:\fixwmi.txt

(this assumes you saved your file as fixwmi.cmd).

Let me know.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 51

Expert Comment

ID: 22901285
Oh, I forgot to tell you to restart WMI service - or restart the server completely.

You can run another WMIdiag if you like.


Author Comment

ID: 22904952
It doesn't run.  The error I receive is "The syntax of the command is incorrect.". I tried moving the fix file directly into the c:\windows\system32\wbem directory and running with and without the output redirected to a file.  I noticed that you mentioned server more than once. This is a Win XP Pro SP2 workstaiton.  Could that be the issue?  I did stop the WMI service.

Thanks again for your assistance
LVL 51

Accepted Solution

Netman66 earned 1000 total points
ID: 22905687
Sorry about that!  I read right past the fact it was a workstation.

Try this:

cd \windows\system32\wbem
for /f %%s in ('dir /b *.mof *.mfl') do mofcomp %s

If that fails then you can completely rebuild WMI by stopping the services and deleting the Repository contents.  Beware that any software installed that adds MOFs to WMI will probably need to be reinstalled if they stop working.


Author Closing Comment

ID: 31512950
I solved the problem working with the software vendor that was collecting the WMI information and relocated it to the local subnet. That solved the immediate issue.
With the suggestion that the last recommended fix might require a reistall of various software and I resolved my immediate WMI issue, I chose not to execute the recommended process and let things remain as they are. It simply was not worth my time to reinstall untold numbers of software that might deposit MOF's to WMI. Thanks to Netman66 for sticking with me and I am sorry for the time lag for this answer. I didn't seen that his last fix had been posted.  So lets give him some points even though I decided not to pursue his last suggestion.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote an article (http://www.experts-exchange.com/articles/2245/Anti-rootkit-software.html) some time ago with a reference to nLite  (http://www.nliteos.com/)slipstreaming software.  I recently changed that link to point to NTLite (https://www.ntl…
In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question