Understanding WMI Scripting

In the previous chapter, when we performed basic monitoring using the SMTP event consumer, we used a WQL query to define and filter the event. When we used the WMI CIM Studio to browse the content of the CIM repository, we did not use a WQL query to retrieve the information, even though WMI CIM Studio provides the ability to perform WQL queries to retrieve CIM information. In the same way, WBEMTEST.exe and WBEMDump.exe are also capable of performing WQL queries. Mastering WQL is very important because it can be used in different places. When working with the scripting interfaces and the WMI events, it is impossible to avoid its usage because a WQL query is the required primary input. This is why, in this chapter, we do not dive immediately into the scripting technique, and instead we focus on WQL. After completion of this chapter, we will be ready to start exploring the WMI scripting API.
| Important notice: | At this stage, it is really important to understand the relationship between the Windows services as described in Chapter 2 (Section 2.9.1). Don't hesitate to compare the result of WQL queries with what is available from WMI CIM Studio. It will be very important for you to practice the queries during this learning phase. It is easy to get lost and confused without practicing! |
As the purpose of the CIM repository is to create a data model that...