1
00:00:00,410 --> 00:00:02,440
[Autogenerated] So now that we've reviewed

2
00:00:02,440 --> 00:00:05,260
the W my name spaces, how do we execute

3
00:00:05,260 --> 00:00:07,630
commands? Well, first off, there are some

4
00:00:07,630 --> 00:00:11,190
core parameters in the majority off W my

5
00:00:11,190 --> 00:00:13,320
commands. The first one would be the

6
00:00:13,320 --> 00:00:15,980
computer name, and this is a computer name

7
00:00:15,980 --> 00:00:20,110
we can specify as a remote endpoint. So if

8
00:00:20,110 --> 00:00:22,090
you're executing these locally, you don't

9
00:00:22,090 --> 00:00:24,070
need to pass the computer name. It will

10
00:00:24,070 --> 00:00:26,370
just inherently communicate to the local

11
00:00:26,370 --> 00:00:29,140
machine. If we pass a computer name, it

12
00:00:29,140 --> 00:00:31,290
will then try to connect remotely to that

13
00:00:31,290 --> 00:00:33,960
machine. Then, of course, we have the list

14
00:00:33,960 --> 00:00:36,670
option. It's just list on its own. And you

15
00:00:36,670 --> 00:00:38,520
could do this to get information about the

16
00:00:38,520 --> 00:00:40,870
W my classes that are available in the

17
00:00:40,870 --> 00:00:43,050
specified name space. So you'll see. When

18
00:00:43,050 --> 00:00:45,380
we looked at the name spaces on, we use

19
00:00:45,380 --> 00:00:47,300
the application to traverse through it

20
00:00:47,300 --> 00:00:49,120
that actually we could just use list and

21
00:00:49,120 --> 00:00:52,240
it would give us a list of those classes.

22
00:00:52,240 --> 00:00:54,220
And then, of course, we have query. Now

23
00:00:54,220 --> 00:00:56,170
the query is quite an important one. It

24
00:00:56,170 --> 00:00:59,270
allows me to run, for example, select type

25
00:00:59,270 --> 00:01:02,720
queries that you would use in SQL to query

26
00:01:02,720 --> 00:01:05,610
the W. M. I. And this is called W Q L,

27
00:01:05,610 --> 00:01:07,640
which is the language So that w my query

28
00:01:07,640 --> 00:01:09,500
language. And so, for example, it would be

29
00:01:09,500 --> 00:01:14,140
select Star from Maybe Win 32 underscore.

30
00:01:14,140 --> 00:01:16,330
You know something on then, whatever that

31
00:01:16,330 --> 00:01:18,900
filters going to be. So it allows us to

32
00:01:18,900 --> 00:01:23,040
retrieve information at a filtered level.

33
00:01:23,040 --> 00:01:24,770
Now, when we're designing or at least

34
00:01:24,770 --> 00:01:27,550
trying to execute these commands, there's

35
00:01:27,550 --> 00:01:30,060
a kind of a standard structure. So the way

36
00:01:30,060 --> 00:01:32,820
this works, we provide the command. So the

37
00:01:32,820 --> 00:01:35,940
W my command that we wish to execute. Then

38
00:01:35,940 --> 00:01:38,480
we provide the class, which I suppose, go

39
00:01:38,480 --> 00:01:40,390
back to the idea of the folder structure.

40
00:01:40,390 --> 00:01:42,030
We're now going to go into the folder

41
00:01:42,030 --> 00:01:45,670
structure to say, I want to query Windows

42
00:01:45,670 --> 00:01:47,680
32 process of, for example, to give me

43
00:01:47,680 --> 00:01:50,190
processing information, then maybe the

44
00:01:50,190 --> 00:01:52,520
name of the machine, whether it's pastors,

45
00:01:52,520 --> 00:01:54,840
a remote machine or a local machine, and

46
00:01:54,840 --> 00:01:56,660
then any queries that we would like to

47
00:01:56,660 --> 00:01:59,270
pass to him. So if we were to kind of run

48
00:01:59,270 --> 00:02:01,230
this, you could imagine that you would see

49
00:02:01,230 --> 00:02:03,050
something like this where we're going to

50
00:02:03,050 --> 00:02:06,340
say get the W my object. So we're using a

51
00:02:06,340 --> 00:02:09,920
get command to retrieve an object from the

52
00:02:09,920 --> 00:02:12,520
database of information. We're filtering

53
00:02:12,520 --> 00:02:15,480
it down to the process, er so I want to

54
00:02:15,480 --> 00:02:19,110
only query process of for example. Then

55
00:02:19,110 --> 00:02:21,210
I'm connecting to a machine called Trainer

56
00:02:21,210 --> 00:02:24,890
and then I'm passing a query. Of course,

57
00:02:24,890 --> 00:02:26,140
what you can see from here is that doesn't

58
00:02:26,140 --> 00:02:28,250
really make sense as a command structure,

59
00:02:28,250 --> 00:02:30,160
because you wouldn't get the name of the

60
00:02:30,160 --> 00:02:32,880
service from a process. Er so you can see

61
00:02:32,880 --> 00:02:34,880
here where we have class and query. And

62
00:02:34,880 --> 00:02:36,680
actually, when we build the actual

63
00:02:36,680 --> 00:02:38,930
commands, sometimes we don't need to use

64
00:02:38,930 --> 00:02:41,330
all of them either. But as an example,

65
00:02:41,330 --> 00:02:43,090
what we could kind of end up with is

66
00:02:43,090 --> 00:02:45,470
something that looks like this. So get to

67
00:02:45,470 --> 00:02:48,440
be my object class, win 32 process, for

68
00:02:48,440 --> 00:02:50,760
example, trainer, and then go to the

69
00:02:50,760 --> 00:02:53,420
services and get the service called Win

70
00:02:53,420 --> 00:02:56,380
RM. So what that would do is retrieve the

71
00:02:56,380 --> 00:02:59,130
process information about the service, and

72
00:02:59,130 --> 00:03:01,180
then we turn that back so the command

73
00:03:01,180 --> 00:03:02,680
structures fairly straightforward. It will

74
00:03:02,680 --> 00:03:05,120
always be this way. You will do something

75
00:03:05,120 --> 00:03:07,400
with the W. My object. You will then

76
00:03:07,400 --> 00:03:10,900
specify a class or a name space or both a

77
00:03:10,900 --> 00:03:12,670
remote or local machine and then

78
00:03:12,670 --> 00:03:16,240
potentially jQuery now to retrieve

79
00:03:16,240 --> 00:03:17,910
processes. For example, running on a

80
00:03:17,910 --> 00:03:20,770
computer. It's a simple a saying Get to be

81
00:03:20,770 --> 00:03:23,600
my object and then utilize the class

82
00:03:23,600 --> 00:03:27,210
called Win 32 underscore process that is a

83
00:03:27,210 --> 00:03:30,750
predetermined class, which we looked at

84
00:03:30,750 --> 00:03:33,240
that will give me information about

85
00:03:33,240 --> 00:03:36,740
current processes running on machines. If

86
00:03:36,740 --> 00:03:38,730
I was to try and do this on a remote

87
00:03:38,730 --> 00:03:41,860
machine, it's exactly the same. Syntax or

88
00:03:41,860 --> 00:03:46,070
B. We pass the computer name as part of

89
00:03:46,070 --> 00:03:50,000
their command. That's the only difference between a local and a remote computer.

