September 13th, 2014

Weekend Scripter: The WMI Explorer Tool

Doctor Scripto
Scripter

Summary: Guest blogger, Vinay Pamnani, talks about a cool new WMI tool.

Microsoft Scripting Guy, Ed Wilson, is here. One of the absolutely greatest things about working for Microsoft is the chance to meet (even virtually) and interact with really smart people who absolutely love technology. I recently ran across a post by Vinay (todays guest blogger) in an internal mailing where he was describing his new WMI Explorer tool. I downloaded the tool, played around with it a bit, and thought about writing a post about it—the tool is that good. But then, I decided it would be better if I could persuade the person who actually designed the tool to write the blog post (because obviously he knows it better than I do). So I reached out to Vinay, and he responded enthusiastically. In fact, he told me that he is currently working on a new iteration of the tool. So I said, “The current offering is cool, why don’t you write a quick overview, and when your new tool ships, you can write a couple of blog posts about it.” He agreed, and I am proud to turn things over to our guest blogger for today. Take it away Vinay…

My name is Vinay Pamnani, and I’m a senior support escalation engineer in the System Center Configuration Manager team. I’ve been working with Configuration Manager for over 7 years, but it didn’t take me long to realize that working with Configuration Manager means you need to work with WMI. As a result, I found myself spending a lot of time in wbemtest, which is a useful utility, but at the same time it’s very time consuming. Additionally, if you haven’t worked with wbemtest enough, it can be hard to navigate through wbemtest to get to where you want to be.

After spending enough time in wbemtest, I found some WMI Explorer utilities, and although they were useful, none of them gave me what I was looking for. Most of the tools I looked at had a feature that I liked, but none of them felt like a complete product that had everything I wanted. So, I decided to start a project with the intention of combining the features of currently available WMI Explorer utilities, and adding the features that I specifically wanted. 

Note  You can download the tool and find a list of features and requirements on CodePlex: WMI Explorer.

WMI Explorer has become integral to the way I work. For example, a few days ago I was looking to find if there’s something in WMI that can give me information about the DHCP server. I pulled up WMI Explorer, selected the root namespace, clicked the Search tab, selected Properties, typed DHCP, and selected the Recursive option. In a matter of seconds, I had a list of every WMI property in every WMI class in every WMI namespace that has a property name that matches “DHCP.” I would compare this with wbemtest…but wait, wbemtest does not have a Search feature! Here are the results from my search:

Image of search results

After reviewing the instances of Win32_NetworkAdapterConfiguration class in root\CIMV2 namespace, I knew that’s what I was looking for. But this class contains a number of instances, and only one of them had the DHCP server populated. I decided to write a script that would get all the instances of Win32_NetworkAdapterConfiguration class so that I could review the output and find the DHCP server. Instead of going to our Scripting Guy, Ed, I pulled up WMI Explorer again and navigated to the Win32_NetworkAdapterConfiguration class in root\CIMV2 namespace, clicked the Scripting tab, and selected VBScript as my script engine of choice. As shown in the following image, I had a script ready to run or save.

Image of script

 My next interaction with WMI involved looking at an embedded property for one of the SMS Provider classes. If you haven’t looked at the value of an embedded property, it’s painfully annoying to find it in wbemtest. Here’s an example of viewing an embedded property in wbemtest (note that I had to navigate through at least five separate windows to see the value for the IISSSLPortsList embedded property, not to mention blindly clicking each property to find the one I was looking for:

Image of windows

Instead of doing this in wbemtest, I pulled up the same instance in WMI Explorer. I expanded the property to get the value, and I was done.

Image of results

I could talk more about other features of WMI Explorer. However, I’ll save that for another post, which will cover the next release that is currently in the works. In the meantime, check it out and let me know what you think on the WMI Explorer Discussions page.

~Vinay

Thank you, Vinay. This is a great tool, and I look forward to seeing what you have in store for us with the next iteration. Join me tomorrow when we have a guest blog post by Windows PowerShell MVP, Sean Kearney. (Yeah, it is the Scripting Guy’s birthday, and Sean thought he would write a cool post for my birthday present.) WooHoo!

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.