Using WMI and CIM in PowerShell

This course teaches you how you can use the CIM cmdlets and PowerShell to manage local and remote systems.
Course info
Rating
(23)
Level
Intermediate
Updated
Jan 15, 2016
Duration
3h 31m
Table of contents
Introduction to the Course
Understanding CIM, WMI, and OMI
Exploring CIM
Connecting to CIM
Understanding CIM Classes
Querying CIM Instances
Invoking CIM Methods
Managing CIM Instances
Writing WQL Queries
Responding to System Events
References, Associators, and Course Conclusion
Description
Course info
Rating
(23)
Level
Intermediate
Updated
Jan 15, 2016
Duration
3h 31m
Description

Windows Management Instrumentation (WMI) is a core component of Windows that enables you to manage hosts both locally and remotely. Virtually every driver and OS subsystem/feature/role supports a WMI interface. As WMI is standards based, it also interoperates with Open Source systems that implement Open Management Instrumentation (OMI). The CIM cmdlets, introduced with PowerShell v3, provide a superior module you can use to manage systems using WMI (both Windows systems and any host that implements OMI). The course first looks at the architecture of WMI, how to explore WMI, and how to connect to WMI on remote and local machines. The course teaches you how to manage your systems with WMI, including creating, modifying, and destroying WMI data instances, invoke WMI methods locally or remotely, and managing eventing. We also look at associators and references used to link WMI data items. The course presents theory, shows how to use PowerShell to perform key operations, and provides demonstrations so you can see this technology at work. The CIM cmdlets are a set of cmdlets you use to manage your system as we show in this course.

About the author
About the author

Thomas is a UK IT Pro, with over 40 year’s experience in the IT field. He’s presently doing writing, consulting and training around some of the key Microsoft technologies including PowerShell, Lync and Windows Server/client.

More from the author
Windows Workflows with PowerShell
Intermediate
2h 31m
Aug 2, 2016
Implementing PowerShell Web Access in Server
Intermediate
1h 35m
Aug 11, 2015
More courses by Thomas Lee
Section Introduction Transcripts
Section Introduction Transcripts

Introduction to the Course
Hi. My name is Thomas Lee, and welcome to this Pluralsight course Using WMI and CIM in PowerShell. This module is an introduction to this course. In this introduction, I'm going to first of all look at the course overview. In particular, I want to look at the objectives for the course. Secondly, I want to look at the prerequisite knowledge I assume you have in order to be most successful at taking and understanding the contents of this course. I've got a demo lab that I've created to introduce you to WMI and CIM and I'll show you that in a short on-screen demo. We'll look at some resources that may help you find more information about WMI and CIM in PowerShell. And finally, we'll finish with a short module summary. Now, one question to answer up front is why does WMI and PowerShell matter? Why do WMI and PowerShell matter to you, an IT pro? Well first of all, WMI enables you to manage all aspects of the computer system, and that's what's a valuable technology for all IT pros. PowerShell makes it easy to use WMI to manage your data center whether that data center is large or small. PowerShell and WMI are therefore a great combination. And finally, WMI is cross-platform and supports open status for maximum interoperability enabling you to manage Windows, as well as Linux, and other systems that follow the open standards.

Understanding CIM, WMI, and OMI
Hi. I'm Thomas Lee, and welcome to this module, Understanding CIM, WMI, and OMI. In this module, I want to first of all look at WMI versus CIM versus OMI, and look at the alphabet soup of acronyms that seems to accompany every discussion of WMI and CIM. Next, we'll look at the WMI architecture, so you'll understand how WMI is structured. Thirdly, we'll look at the PowerShell cmdlets you can use to access the information in WMI. We'll look at the WMI cmdlets that came with version 1 of PowerShell, and we'll also look at the CIM cmdlets that have been in PowerShell since PowerShell V3. Next, we'll look at the CIM information structure and look how the database, the CIM database, is structured. And finally, we'll look at the protocols and ports used in WMI and CIM.

Exploring CIM
Hi. I'm Thomas Lee. Welcome to this module, Exploring CIM. Now in this module, I first of all what to look at how you can find CIM namespaces. Having found namespaces, we want to look and find new classes in those namespaces. And then we'll look at how you can access the class instances of those classes. And we'll look at some of the tools you can use to explore WMI further. And finally, we'll have a demonstration and some resources.

Connecting to CIM
Hello. My name is Thomas Lee, and welcome to this module, Connecting to CIM. In this module, we're going to look at CIM connections, and these are connections made between where you run CIM cmdlets and the target machine you're running them against, and that can be for running the cmdlets both locally and remotely. We'll look at creating and using explicit CIM sessions using WinRM or WSMan, and we'll look at creating and using CIM sessions using DCOM. We'll talk about some best practice. I'll give you an online demonstration of these concepts, and then we'll complete the module by looking at some resources and a module summary.

Understanding CIM Classes
Hello. I'm Thomas Lee. Welcome to this module, Understanding CIM Classes. Now in this module, I want to first of all start with a bit of a review of CIM classes, then we'll look at understanding WMI qualifiers. I'll review finding and interpreting the WMI documentation, particularly, that found out on MSDN, we've got a demonstration of some of these concepts, and then I'll finish up with resources, and of course, a module summary.

Querying CIM Instances
Hi. My name is Thomas Lee, and welcome to this module, Querying CIM Instances. Now in this module, we're first of all going to look at what is querying, and then we'll look at querying both for classes and instances, remotely and locally. We'll look at querying for one or more instances and look at how you need to plan for that. We'll talk about filtering instances using the -Filter parameter of Get-CimInstance. We'll also look at how you can filter the properties returned. We'll have a short demonstration. We'll then look at some best practice, resources, and a module summary.

Invoking CIM Methods
Hi. I'm Thomas Lee, and welcome to this module, Invoking CIM Methods. In this module, we're first of all going to look at how you discover both methods and the parameters for those methods that are available on CIM classes. We'll look at how you invoke those methods on the CIM classes. We'll look at the data that's returned when you invoke a method. There will be a demonstration and I'll finish up with some resources and a module summary.

Managing CIM Instances
Hi. I'm Thomas Lee, and welcome to this module, Managing CIM Instances. In this module, I first of all want to look at using the class and instance methods to manage CIM data. I want to look briefly at using the methods that come with the WMI class or instance to actually manage the data that's in the WMI repository. Then I want to look at using the CIM instance lifecycle cmdlets, New-CimInstance, Set-CimInstance, Remove-CimInstance. These can be quite useful in a number of cases. And finally, I want to also look at how we can create, update, and remove instances both locally and remotely.

Writing WQL Queries
Hello. My name is Thomas Lee, and welcome to this module, Writing WQL Queries. Now in this module, we're going to be looking at WMI query language, WQL. I'm going to start off by explaining what WQL is, we'll look at its structure, we'll look at using Get-CimInstance and both the -Filter parameter and using a full WMI query. We'll look at how you can return some or all properties and some or all instances, also known as early filtering. We'll look at some additional WQL keywords. We'll look in particularly using the -Filter parameter on Get-CimInstance against the WHERE clause in a WQL query. I have a demonstration where I'll demonstrate some of these actions against a CIM database, and then we'll have a quick WQL performance. I'll finish with references and a module conclusion.

Responding to System Events
Hi. Welcome to this module, Responding to System Events. In this module, we will first of all look at what are system events within WMI? What are WMI events? We'll look at the event types and how you could invoke them, we'll talk about using WQL in event queries, and we'll look at also creating permanent event consumers. I'll show you some of these things in a demonstration and we'll finish off with best practice and some eventing resources. So let's get started.

References, Associators, and Course Conclusion
Hello. I'm Thomas Lee. Welcome to this module, References, Associators, and Course Conclusion. In this module, we're going to first of all look at what are references and associators within WMI, and we'll look at how you can query for references and associations, there'll be a short demo, we'll follow that with a module summary, and I'll follow that with a course summary. So let's get started.