1
00:00:00,240 --> 00:00:04,270
So the next question is, why would you use PowerShell remoting?

2
00:00:04,270 --> 00:00:08,340
Well, it's important to understand the benefits of PowerShell remoting.

3
00:00:08,340 --> 00:00:12,180
The first one of these is that we get to execute single or

4
00:00:12,180 --> 00:00:15,440
multiple commands against remote machines.

5
00:00:15,440 --> 00:00:19,170
So we can simply say execute this single command, so, for example,

6
00:00:19,170 --> 00:00:22,930
Get‑ComputerInfo, or we can say Get‑ComputerInfo,

7
00:00:22,930 --> 00:00:24,200
do some interrogation,

8
00:00:24,200 --> 00:00:27,510
update a registry entry, and then return some results back.

9
00:00:27,510 --> 00:00:32,540
So we can run single or multiple via a single connection.

10
00:00:32,540 --> 00:00:37,860
It also allows execution of either static commands, so I mentioned one earlier,

11
00:00:37,860 --> 00:00:42,360
Get‑ComputerInfo, which will basically list me computer details. If you

12
00:00:42,360 --> 00:00:45,440
were to run that on your Windows device right now, it would come back

13
00:00:45,440 --> 00:00:50,140
with memory, storage, processor, name, etc.

14
00:00:50,140 --> 00:00:55,480
I can run that command, which is a general PowerShell cmdlet, or I can

15
00:00:55,480 --> 00:00:58,460
tell it to execute a custom script that I've written.

16
00:00:58,460 --> 00:01:02,810
So maybe I took some of the regular commands, batched them altogether.

17
00:01:02,810 --> 00:01:03,630
So, for example,

18
00:01:03,630 --> 00:01:07,330
let's say I wanted to run a report every single week on

19
00:01:07,330 --> 00:01:09,940
certain machines' disk space, for example,

20
00:01:09,940 --> 00:01:14,620
I could run the static commands inside a PowerShell script and then

21
00:01:14,620 --> 00:01:17,800
make it render out a nice HTML report, for example.

22
00:01:17,800 --> 00:01:20,280
So instead of executing the static command,

23
00:01:20,280 --> 00:01:23,340
I execute my script, which does all of that.

24
00:01:23,340 --> 00:01:26,430
And, of course, our last benefit here is that we can execute

25
00:01:26,430 --> 00:01:30,640
commands against multiple machines simultaneously.

26
00:01:30,640 --> 00:01:35,040
So the idea here with PowerShell remoting is that I can say I want to

27
00:01:35,040 --> 00:01:38,160
get, so I'll go back to our example of Get‑ComputerInfo,

28
00:01:38,160 --> 00:01:41,550
I want to run that against my entire forest estate.

29
00:01:41,550 --> 00:01:43,590
So let's say I have 100 servers,

30
00:01:43,590 --> 00:01:49,700
I could in reality run Get‑ComputerInfo 100 times manually by

31
00:01:49,700 --> 00:01:54,370
hopping onto each server, that's 100 connections, or I could simply

32
00:01:54,370 --> 00:01:59,510
use PowerShell remoting and blast that out to a list of 100, and

33
00:01:59,510 --> 00:02:01,210
then manage the outputs of them.

34
00:02:01,210 --> 00:02:09,000
So really powerful benefits that come from being able to do PowerShell remoting when you're managing a server estate.

