Doing things without WMI

Coordinator
Feb 21, 2011 at 5:11 PM

We cannot rely on WMI being healthy when doing our health checks.  So, one of the 'fun' aspects of coding a system health tool using VB Script, is to do so without WMI and using in-built tools.  You'll notice these scripts do not use WMI at all.

Here are some ways the scripts overcome this challenge:

  • For managing services, they use ADSI and sc.exe
  • To get network configuration details, the use IPConfig.exe
  • To manage the registry, they use Windows Script Host features and reg.exe

Just as with WMI, there are some nice features available to VB Script from the .Net Framework -if installed.  However, we can't bank on it being installed or functioning properly for our use.

Coordinator
Feb 21, 2011 at 5:14 PM

Well, I should mention that there are a few WMI calls -I think in the registry class (I remembered this just as I submitted this thread).  The code will fail over to legacy 'old school' methods if the WMI methods fail.

Coordinator
Mar 3, 2011 at 2:22 PM

Hmmm.  There are also WMI calls in my Process class.  I'll have to change those over to legacy methods. There are some WMI calls when managing the ConfigMgr client cache, but those are way down in the code and wouldn't be called unless WMI is working.