Understanding WMI Scripting

Chapter 5: Advanced WMI Scripting Techniques

5.1 Objective

In the previous chapter, we examined the WMI scripting object model with its basic operations to retrieve real-world manageable object information. Although, we perform the exact same task in this chapter, we explore some advanced scripting techniques with the same set of WMI scriptable objects. In the previous chapter, we used a specific set of methods that implemented synchronous scripting techniques, which resulted in a WMI operation (i.e., retrieving instance information) executing in-line with the code execution. In this chapter, we see how to use the WMI asynchronous operations by examining another set of methods available from the same WMI object collection. The asynchronous scripting techniques allow the execution of one more subroutine in parallel, which increases the execution performance. WMI extends ADSI by adding new properties and methods to facilitate the instantiation of some WMI scriptable objects. Moreover, WMI also exposes some helper objects to manipulate the DMTF date format or to retrieve instance information in XML. Let's see how these advanced features work.

5.2 Working with CIM instances asynchronously

The SWbemServices and SWbemObject objects expose various methods to perform different tasks (see Tables 4.8 and 4.10). Some of these methods are executed in line with the script code and force the script to pause until the method is executed (synchronous execution). Depending on the action to be performed, some methods may take some time to execute (i.e., stopping the Exchange Information Store service of an Exchange server hosting a mailbox store of 25 GB...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: 3D Scanners
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.