WMI woes

Every SA eventually comes across a weird problem with a server that just doesn’t seem to make sense. I recently had one such problem with an old server at work. This machine was fraught with problems when I took the job, but since it was the one and only DC at the time, I had no choice but to fix it. After fixing the problems I knew about, one of the first things I did was to replace that machine. Rather than retiring the old machine, I kept it around as a backup. We migrated to Windows Server 2003 at that time and recently went fully native after updating that old box. The upgrade worked flawlessly, or so I thought. When I attempted to install a service pack I got a strangely vague error message at the very end. “An error in updating your system has occurred.” A look through svcpack.log showed 2 problems at the very end of the process. A program called mofcomp was exiting with a return code of 3. That indicates a syntax error, which didn’t make sense as the syntax was correct. A search for the next line: “DoInstallation:RunInfProcesses for ProcessesToRun Failed” brought me to Katy Coe’s tutorial on how to fix WMI repository corruption. She does a great job in her article, but after trying the applicable steps, I still had trouble. I eventually found a reference to a Microsoft tool (which I would have found on Katy’s site if I’d just scrolled.. doh!) called WMIdiag. This tool saved the day. It found a number of problems with a handful of unregistered DLLs and EXEs. After registering the components and checking through the suggestions in the WMIdiag log the mofcomp program compiled the MOF files. The service pack installed and all was well. I didn’t have to go to all this trouble, I could have retired the machine and been done with it. After all, the server wasn’t even a critical part of my infrastructure, but it was an interesting problem to solve and I learned a few things in the process.