Chapter 39. WMI and CIM


This chapter covers

  • Introducing WMI
  • Understanding the WMI and CMI cmdlets
  • Working with CIM sessions and CDXML

Including a chapter on Windows Management Instrumentation (WMI) and the Common Information Model (CIM) in an advanced PowerShell book may seem to be an odd move, but in reality PowerShell and WMI are closely linked—we’ve written much on using WMI with PowerShell, two powerful technologies that combine to give a huge amount of functionality. PowerShell v3 makes this combination even more powerful because 60 percent of the new PowerShell cmdlets delivered in Windows Server 2012 are produced from WMI classes as “cmdlets over objects,” which we’ll cover at the end of the chapter.

The chapter starts with an overview of WMI and explains the relationship between WMI and CIM. PowerShell cmdlets have been available to work with WMI since PowerShell v1. We provide an overview of those cmdlets that focuses on the issues and intricacies of using these cmdlets rather than detailed explanations.

The bulk of this chapter is taken up with a detailed examination of the Power-Shell v3 CIM cmdlets. These are analogous to the WMI cmdlets but extend the range of functionality. Closely related to the CIM cmdlets are CIM sessions, which are similar to the PowerShell Remoting session and provide an easy way to remove the dependence on the Distributed Component Object Model (DCOM) for accessing WMI on remote systems.

39.1. What is WMI?

39.2. WMI cmdlets

39.3. CIM cmdlets

39.4. CIM sessions

39.5. “Cmdlets over objects”

39.6. Summary