1 00:00:01,140 --> 00:00:04,640 [Autogenerated] now let's turn our attention to Windows PowerShell remoting 2 00:00:04,640 --> 00:00:08,630 now let me actually pause for a second because if you've been following this 3 00:00:08,630 --> 00:00:12,860 learning path sequentially and I always say that and I say I hope you have 4 00:00:12,860 --> 00:00:16,890 and that's because I like our knowledge to build sequentially and I had 5 00:00:16,890 --> 00:00:21,900 mentioned earlier in the path that the A C 808 01 exams don't make a 6 00:00:21,900 --> 00:00:26,710 difference between Windows PowerShell that is PowerShell 51 and PowerShell 7 00:00:26,710 --> 00:00:30,330 core version seven, I'm not exactly sure why that's the case. 8 00:00:30,330 --> 00:00:32,380 And matter of fact, if anything, 9 00:00:32,380 --> 00:00:38,080 I find that a C 808 01 skew wildly towards Windows PowerShell so 10 00:00:38,080 --> 00:00:41,770 although most of what we're talking about here in this section of 11 00:00:41,770 --> 00:00:45,160 the module is applicable to Windows core, 12 00:00:45,160 --> 00:00:49,160 we're going to be again in a Windows PowerShell 5.1 environment. 13 00:00:49,160 --> 00:00:50,070 That having been said, 14 00:00:50,070 --> 00:00:54,900 let's continue Windows PowerShell remoting is the process of using the 15 00:00:54,900 --> 00:01:00,030 industry standard WS management protocol in order to allow you to run power 16 00:01:00,030 --> 00:01:02,800 Shell commands on one or more remote computers, 17 00:01:02,800 --> 00:01:07,990 this is great because a single PowerShell command can deliver commands 18 00:01:07,990 --> 00:01:13,330 to basically limitless number of destination Windows server hosts and 19 00:01:13,330 --> 00:01:18,040 underlying the WS management protocol which operates under http or 20 00:01:18,040 --> 00:01:25,040 https we have in Windows server, the Windows remote management or win RM service, 21 00:01:25,040 --> 00:01:28,840 what does enabling PowerShell remoting actually do 22 00:01:28,840 --> 00:01:30,940 well enabling remoting on a machine. 23 00:01:30,940 --> 00:01:34,280 Configures that computer to receive remote command. 24 00:01:34,280 --> 00:01:39,750 So enabling PS remoting configures Windows device to serve as an 25 00:01:39,750 --> 00:01:43,360 endpoint for incoming PowerShell remoting requests. 26 00:01:43,360 --> 00:01:46,780 I found that a little bit counterintuitive when I first learned 27 00:01:46,780 --> 00:01:50,620 that enabling ps remoting starts or ensures that the win RM 28 00:01:50,620 --> 00:01:53,150 services started and set for auto start, 29 00:01:53,150 --> 00:01:55,600 you'll get an http listener and yes, 30 00:01:55,600 --> 00:02:00,160 that means it's not encrypted with TLS although PowerShell 31 00:02:00,160 --> 00:02:03,550 remoting is encrypted by default in other means you can 32 00:02:03,550 --> 00:02:07,000 configure HTTPS with Ws MAN. 33 00:02:07,000 --> 00:02:11,550 remoting and you also can use secure shell as a transport as well for that 34 00:02:11,550 --> 00:02:15,990 matter enabling PS remoting on a system defines Windows defender, 35 00:02:15,990 --> 00:02:19,900 firewall exception for Ws man defines PowerShell session, 36 00:02:19,900 --> 00:02:24,290 endpoints and session configurations so what you have on a Windows server 37 00:02:24,290 --> 00:02:28,230 machine that's set up for PowerShell remoting are one or more session 38 00:02:28,230 --> 00:02:31,360 configurations that you can constrain and customize. 39 00:02:31,360 --> 00:02:32,170 As a matter of fact, 40 00:02:32,170 --> 00:02:36,680 that concept of a constrained session and point on a server 41 00:02:36,680 --> 00:02:40,030 is the heart of just enough administration or JIA that 42 00:02:40,030 --> 00:02:41,680 we'll learn about momentarily. 43 00:02:41,680 --> 00:02:45,520 How do we configure PowerShell remoting on a Windows system Well know 44 00:02:45,520 --> 00:02:50,350 that Ws man remoting is enabled by default on Windows server but on a 45 00:02:50,350 --> 00:02:53,190 client device for example you've got enabled. 46 00:02:53,190 --> 00:02:56,670 Ps remoting that's one of the core PowerShell commands 47 00:02:56,670 --> 00:03:00,260 and you can force that configuration, bypassing, 48 00:03:00,260 --> 00:03:01,660 skip network profile, 49 00:03:01,660 --> 00:03:05,640 check and force that would ensure that remoting has enabled 50 00:03:05,640 --> 00:03:09,500 regardless of the location profile of the client devices Windows 51 00:03:09,500 --> 00:03:12,850 firewall easily enable the https listener. 52 00:03:12,850 --> 00:03:14,000 You can run the WIN. 53 00:03:14,000 --> 00:03:16,330 RM compiled executable WIN. 54 00:03:16,330 --> 00:03:19,770 RM Quick Config Transport HTTPS Note that you'll have 55 00:03:19,770 --> 00:03:22,780 to configure an SsL TLS certificate. 56 00:03:22,780 --> 00:03:26,830 You also can make use of the cis internals tools for instance PS 57 00:03:26,830 --> 00:03:30,640 executive this example shows you how to configure remoting on a 58 00:03:30,640 --> 00:03:33,330 remote machine where you're running PS exact, 59 00:03:33,330 --> 00:03:37,790 that's a sys internals tool that allows you to run commands remotely. 60 00:03:37,790 --> 00:03:41,750 In this case you're invoking the PowerShell engine and then 61 00:03:41,750 --> 00:03:44,850 within the context of that process running, 62 00:03:44,850 --> 00:03:47,740 enable ps remoting force. 63 00:03:47,740 --> 00:03:52,620 PowerShell direct refers to using PowerShell remoting from the context of a 64 00:03:52,620 --> 00:03:58,260 hyper V host to target Hyper-V guest VMS so you might know hopefully are 65 00:03:58,260 --> 00:04:02,970 familiar with enter PS session where we can tap into a remote windows 66 00:04:02,970 --> 00:04:07,430 server machine like you see here but notice that nowadays enter PS session 67 00:04:07,430 --> 00:04:09,630 besides having a computer name, parameter, 68 00:04:09,630 --> 00:04:12,400 there is also a VM name parameter and this is 69 00:04:12,400 --> 00:04:15,310 supporting PowerShell direct scenarios. 70 00:04:15,310 --> 00:04:18,660 The other way to do remote PowerShell is invoked command 71 00:04:18,660 --> 00:04:22,640 and again we can do computer name or VM name in this 72 00:04:22,640 --> 00:04:24,850 context if we're on the hyper V host, 73 00:04:24,850 --> 00:04:28,240 if you want a persistent PowerShell remoting session, 74 00:04:28,240 --> 00:04:32,620 we can create that with new PS session and pack it into a variable as you 75 00:04:32,620 --> 00:04:36,370 see here and one neat thing about creating these persistent remoting 76 00:04:36,370 --> 00:04:40,110 sessions is that you can reference those sessions and other commands like 77 00:04:40,110 --> 00:04:43,290 to copy files within the session, 78 00:04:43,290 --> 00:04:46,900 one computer to another or from the hyper V host to 79 00:04:46,900 --> 00:04:49,290 the Hyper-V guest or vice versa. 80 00:04:49,290 --> 00:04:50,160 Based on what, 81 00:04:50,160 --> 00:04:57,000 you specify for path and destination here in this example using the copy item cmdlet