WEBVTT

00:00:00.160 --> 00:00:02.780
So now that we know how to use the basic Invoke‑Command,

00:00:02.780 --> 00:00:08.140
now let's look at how the CIM PowerShell modules can help us with this.

00:00:08.530 --> 00:00:11.020
The first thing is to understand the CIM commands.

00:00:11.500 --> 00:00:14.060
The Common Information Model, or the CIM commands,

00:00:14.060 --> 00:00:17.330
are part of an open source standard for accessing and

00:00:17.330 --> 00:00:19.590
displaying information about a computer.

00:00:20.140 --> 00:00:23.890
The CIM classes are the parent classes with which

00:00:24.200 --> 00:00:26.280
WMI classes were actually built.

00:00:26.800 --> 00:00:30.820
CIM data breaks down into what's called CIM classes.

00:00:31.020 --> 00:00:32.560
So let's say, for example,

00:00:32.570 --> 00:00:36.610
a USB device connected to a machine would have CIM data,

00:00:36.610 --> 00:00:40.790
but there would be a CIM class to be able to access that information.

00:00:41.230 --> 00:00:45.070
CIM classes hold categories of the Windows

00:00:45.080 --> 00:00:46.740
information that we're trying to get to.

00:00:47.840 --> 00:00:51.700
So when using CIM commands, we have our Get‑CimClass,

00:00:51.700 --> 00:00:55.800
which will allow us to pick the class that we're trying to get to,

00:00:55.800 --> 00:00:59.670
and then the Get‑CimInstance will allow us to get the

00:00:59.680 --> 00:01:02.080
instance of the class that we've chosen.

00:01:02.080 --> 00:01:08.800
Now the first CIM command that we need to look at is the Get‑CimClass.

00:01:09.840 --> 00:01:10.670
Now as we talked about,

00:01:10.670 --> 00:01:15.230
the Get‑CimClass allows us to see all of the classes that are available.

00:01:15.230 --> 00:01:19.280
What it also allows us to do, if I just come back here and say Get‑SimClass,

00:01:19.280 --> 00:01:22.980
is to actually specify a class name.

00:01:22.980 --> 00:01:28.440
And then because I may not know what the class name is I'm looking for,

00:01:28.450 --> 00:01:31.280
you can see that I can use this kind of star mechanism.

00:01:31.280 --> 00:01:35.120
So I can say Win32 because that's obviously the prefix, and then I'm

00:01:35.120 --> 00:01:37.830
looking for everything that has the word system.

00:01:38.050 --> 00:01:42.540
So this will allow me to find operating system, computer system, etc.

00:01:43.020 --> 00:01:48.140
If I am unsure and maybe I know I want to interrogate the computer,

00:01:48.250 --> 00:01:52.990
I can say Computer*, and that will do the same thing and this time get me

00:01:53.000 --> 00:01:57.510
everything that's related to Win32_Computer something.

00:01:57.670 --> 00:02:00.870
So of course, in that list, you can see ComputerSystem,

00:02:00.890 --> 00:02:04.430
you can see ComputerSystemEvent, etc. Now the most important thing

00:02:04.430 --> 00:02:07.390
to note here is that we have a CimClassName,

00:02:07.600 --> 00:02:10.490
then we have what's called a CimClassMethod, and

00:02:10.490 --> 00:02:12.350
then we have CimClassProperties.

00:02:12.930 --> 00:02:15.220
So when we're querying information,

00:02:15.230 --> 00:02:18.070
the list of properties are important because it will allow us to

00:02:18.070 --> 00:02:22.840
see the values or query those values that we need. Now the

00:02:22.840 --> 00:02:25.010
CimClassMethods we'll talk about in a minute,

00:02:25.020 --> 00:02:29.450
but that allows me to interact with specific things that we've retrieved.
