To say that I use WMI (and WMIC) on a daily basis is an understatement. It saves me so much time, but I did run into this bug which I wasted a little time on.
I remembered that there was a WMIC alias called PRODUCT which returned a lot of useful data about what software was installed on the Windows Server 2003 instance. However when I changed jobs from one organisation to another, this function no longer worked for me. I would get an error just like this one:
C:\WINDOWS\system32>wmic product
Node - Server1
ERROR:
Code = 0x80041010
Description = Invalid class
Facility = WMI
The solution was very simple. It turns out that the Windows Installer information is not available in WMI until you install an optional Windows component called "WMI Windows Installer Provider". This component can be installed through "Add/Remove Windows Components"... look for the "Management and Monitoring Tools" group.
If you plan on deploying this to a large fleet of servers, I would recommend you learn about a tool for enabling Windows components in an automated way. The Microsoft tool to do that is called SysOCMgr.exe and is described here. I might right some detailed stuff about SysOCMgr.exe later, so watch this space.
Wednesday, December 10, 2008
Subscribe to:
Posts (Atom)