WEBVTT

00:00.000 --> 00:03.285
>> Hello everyone. I'm
instructor Jerry Roberts,

00:03.285 --> 00:05.190
and this is
PowerShell scripting.

00:05.190 --> 00:07.200
In this video,
we're going to talk

00:07.200 --> 00:09.495
about how to get some
computer information,

00:09.495 --> 00:14.340
and we're going to use
a CIMinstance command.

00:14.340 --> 00:18.180
To do that, we're going
to look at CIMinstance,

00:18.180 --> 00:23.190
we're going to look at the
get CIMinstance command,

00:23.190 --> 00:25.099
and then we're going to
look at some classes

00:25.099 --> 00:26.885
for CIMinstance,

00:26.885 --> 00:28.970
which are the Win32 desktop,

00:28.970 --> 00:32.465
Win32 bios, Win32 processor,

00:32.465 --> 00:36.490
and Win32 computer
system classes.

00:37.040 --> 00:40.620
Using CIMinstance to get
computer information.

00:40.620 --> 00:43.370
Now, we can use the CIMinstance

00:43.370 --> 00:45.754
>> to get information
about a computer.

00:45.754 --> 00:49.400
>> CIM actually stands for
Common Information Module.

00:49.400 --> 00:53.375
This particular module
works with WMI,

00:53.375 --> 00:56.149
which is the Windows
Management Instrumentation,

00:56.149 --> 00:58.624
>> to gather information.

00:58.624 --> 01:01.310
>> You may be
familiar with WMI if

01:01.310 --> 01:05.250
you've worked with
remote computers before.

01:06.170 --> 01:09.320
The get CIMinstance command

01:09.320 --> 01:10.580
>> is a command that we actually

01:10.580 --> 01:14.695
>> use to get the information
about a computer.

01:14.695 --> 01:16.670
With the command, you have to

01:16.670 --> 01:18.935
specify an item you want to get,

01:18.935 --> 01:23.570
thus where the dash class
name portion comes into play.

01:23.570 --> 01:26.120
This particular
parameter allows you to

01:26.120 --> 01:30.300
specify which class of
information you want to get.

01:30.850 --> 01:35.300
Another parameter you can
use is dash computer name.

01:35.300 --> 01:37.610
Now, if you're running
the command locally,

01:37.610 --> 01:39.530
you don't have to
use computer name.

01:39.530 --> 01:41.900
Computer name is used
solely for when you're

01:41.900 --> 01:44.000
>> working with another
computer other than

01:44.000 --> 01:46.690
>> the one that you're
currently using.

01:46.690 --> 01:48.770
That would be say,
if you're connecting

01:48.770 --> 01:51.910
remotely to another
server or another client,

01:51.910 --> 01:55.080
and trying to gather
information about it.

01:55.150 --> 02:00.550
A couple of classes
for our CIMinstance.

02:00.550 --> 02:03.575
The first one is Win32_desktop.

02:03.575 --> 02:06.890
This particular one does
what it sounds like,

02:06.890 --> 02:09.050
and it gets information
about the desktop.

02:09.050 --> 02:10.940
It will gather information about

02:10.940 --> 02:13.310
all the desktops on a
specified computer,

02:13.310 --> 02:16.380
whether or not they are in use.

02:16.580 --> 02:20.620
The next one is Win 32_ BIOS.

02:20.620 --> 02:22.595
This one also does
when it sounds like,

02:22.595 --> 02:26.370
it gives information for
the BIOS as well as UEFI.

02:27.430 --> 02:31.100
Processor is another
one we can use,

02:31.100 --> 02:33.140
and the win 32_ processor

02:33.140 --> 02:35.090
does exactly what it
sounds like as well

02:35.090 --> 02:36.740
and gets information for

02:36.740 --> 02:40.525
your processor or processors
of that computer.

02:40.525 --> 02:46.175
The Win 32_ Computer System
is another useful class,

02:46.175 --> 02:48.380
and this class lists information

02:48.380 --> 02:51.630
about the computer
manufacturer and model.

02:52.970 --> 02:55.830
It's now time for a short demo,

02:55.830 --> 03:00.160
so we can take a look at
CIMinstance in action.

03:00.400 --> 03:02.720
Now that we have PowerShell up,

03:02.720 --> 03:06.845
we can take a look at the
get CIMinstance in action.

03:06.845 --> 03:09.545
When you're doing
that, you do get

03:09.545 --> 03:15.270
CIMinstance space
dash class name,

03:15.270 --> 03:16.940
and you specify which class

03:16.940 --> 03:18.650
you want to get
information about.

03:18.650 --> 03:20.090
We're going to go
through the couple,

03:20.090 --> 03:21.590
we went through the
PowerPoint just so

03:21.590 --> 03:23.725
you can take a look at
what that looks like.

03:23.725 --> 03:28.665
The first one we're going
to do is win32_ desktop.

03:28.665 --> 03:31.670
That shows us that there are

03:31.670 --> 03:35.180
a couple of desktops in
this particular machine.

03:35.180 --> 03:37.430
There's a system,
a local service,

03:37.430 --> 03:38.645
a network service,

03:38.645 --> 03:42.330
there's mine, and there's
of course the default.

03:42.820 --> 03:46.415
All these settings are
located in your registry.

03:46.415 --> 03:48.290
Now, the next one
we want to look

03:48.290 --> 03:51.185
at is going to be
BIOS information,

03:51.185 --> 04:00.120
so we do get CIMinstance-class
name win32_bios.

04:02.210 --> 04:06.840
Now we have information
about the bios.

04:07.240 --> 04:11.525
Next, we'll take a
look at processor.

04:11.525 --> 04:21.780
It's get-ciminstance -
class name win32_processor.

04:25.900 --> 04:29.405
Here I have more information
about my processor.

04:29.405 --> 04:31.580
Now, if I wanted to make that
look a little bit better,

04:31.580 --> 04:34.470
I could pipe in a format list,

04:35.470 --> 04:37.610
and you would get a
little bit better

04:37.610 --> 04:39.810
outputs so you could read it.

04:40.130 --> 04:44.090
Now, one thing you would
want to notice here

04:44.090 --> 04:46.340
is that when you're pulling

04:46.340 --> 04:49.220
this information and
doing the commands,

04:49.220 --> 04:52.105
this is not a case
sensitive module.

04:52.105 --> 04:54.910
Anytime you do get CIMinstance,

04:54.910 --> 04:58.430
you don't have to be very
careful about the case.

04:58.430 --> 05:01.550
The last one we're going
to do is we're going to do

05:01.550 --> 05:06.270
the win32_ computer system,

05:06.380 --> 05:10.400
and you get information about
the particular computer.

05:10.400 --> 05:11.900
Now, again, this
is one of the ones

05:11.900 --> 05:12.860
>> you're probably going to want

05:12.860 --> 05:15.730
>> a format list so it
looks a little bit better.

05:15.730 --> 05:17.720
But you get the idea there,

05:17.720 --> 05:20.180
that these particular classes
give you quite a bit of

05:20.180 --> 05:24.680
information about different
pieces on your system.

05:24.680 --> 05:26.420
These are super useful,

05:26.420 --> 05:27.919
especially in an enterprise

05:27.919 --> 05:29.840
environment when
you're trying to get

05:29.840 --> 05:31.190
information about all of

05:31.190 --> 05:33.590
the computers that are
working on the network,

05:33.590 --> 05:35.630
so you have a better idea of

05:35.630 --> 05:38.510
a baseline as well as
what you're working with,

05:38.510 --> 05:40.880
and whether you need
to do updates or

05:40.880 --> 05:43.945
you need to change
out equipment.

05:43.945 --> 05:48.840
Also, notice that when I
put and Get-CIMinstance,

05:48.840 --> 05:51.745
I didn't do the dash class name.

05:51.745 --> 05:53.990
This is one of
those instances in

05:53.990 --> 05:56.255
which the perimeter
order counts,

05:56.255 --> 05:58.820
so you can put the value in,

05:58.820 --> 06:02.330
and not have to do the
parameter name itself.

06:02.330 --> 06:05.490
The parameter's still
required, just not the name.

06:05.490 --> 06:09.985
Now that we've finished
our demo, it's onto quiz.

06:09.985 --> 06:14.000
This post assessment
question wants you to

06:14.000 --> 06:15.740
know if you wanted to list

06:15.740 --> 06:17.630
information about
the computer bios,

06:17.630 --> 06:20.585
which CIMinstance
class would you use?

06:20.585 --> 06:24.080
Would you use a win32_
computer system,

06:24.080 --> 06:26.140
the win32 bios,

06:26.140 --> 06:31.630
the win32_bios, or the
win 32 processors?

06:31.630 --> 06:33.530
I'll go ahead and
give you a second

06:33.530 --> 06:34.955
to see if you can
figure that out.

06:34.955 --> 06:37.920
You can also pause the
video if you'd like.

06:40.490 --> 06:44.835
The answer is C, win32_ bios.

06:44.835 --> 06:48.180
Remember, when
32_bios is a class,

06:48.180 --> 06:51.870
it contains information
about the bias and the UV.

06:51.950 --> 06:56.510
In this video, we learned
some information about

06:56.510 --> 07:01.110
getting computer information
using Get-CIMinstance.

