[Autogenerated] now let's turn our attention to Windows PowerShell remoting
now let me actually pause for a second because if you've been following this
learning path sequentially and I always say that and I say I hope you have
and that's because I like our knowledge to build sequentially and I had
mentioned earlier in the path that the A C 808 01 exams don't make a
difference between Windows PowerShell that is PowerShell 51 and PowerShell
core version seven, I'm not exactly sure why that's the case.
And matter of fact, if anything,
I find that a C 808 01 skew wildly towards Windows PowerShell so
although most of what we're talking about here in this section of
the module is applicable to Windows core,
we're going to be again in a Windows PowerShell 5.1 environment.
That having been said,
let's continue Windows PowerShell remoting is the process of using the
industry standard WS management protocol in order to allow you to run power
Shell commands on one or more remote computers,
this is great because a single PowerShell command can deliver commands
to basically limitless number of destination Windows server hosts and
underlying the WS management protocol which operates under http or
https we have in Windows server, the Windows remote management or win RM service,
what does enabling PowerShell remoting actually do
well enabling remoting on a machine.
Configures that computer to receive remote command.
So enabling PS remoting configures Windows device to serve as an
endpoint for incoming PowerShell remoting requests.
I found that a little bit counterintuitive when I first learned
that enabling ps remoting starts or ensures that the win RM
services started and set for auto start,
you'll get an http listener and yes,
that means it's not encrypted with TLS although PowerShell
remoting is encrypted by default in other means you can
configure HTTPS with Ws MAN.
remoting and you also can use secure shell as a transport as well for that
matter enabling PS remoting on a system defines Windows defender,
firewall exception for Ws man defines PowerShell session,
endpoints and session configurations so what you have on a Windows server
machine that's set up for PowerShell remoting are one or more session
configurations that you can constrain and customize.
As a matter of fact,
that concept of a constrained session and point on a server
is the heart of just enough administration or JIA that
we'll learn about momentarily.
How do we configure PowerShell remoting on a Windows system Well know
that Ws man remoting is enabled by default on Windows server but on a
client device for example you've got enabled.
Ps remoting that's one of the core PowerShell commands
and you can force that configuration, bypassing,
skip network profile,
check and force that would ensure that remoting has enabled
regardless of the location profile of the client devices Windows
firewall easily enable the https listener.
You can run the WIN.
RM compiled executable WIN.
RM Quick Config Transport HTTPS Note that you'll have
to configure an SsL TLS certificate.
You also can make use of the cis internals tools for instance PS
executive this example shows you how to configure remoting on a
remote machine where you're running PS exact,
that's a sys internals tool that allows you to run commands remotely.
In this case you're invoking the PowerShell engine and then
within the context of that process running,
enable ps remoting force.
PowerShell direct refers to using PowerShell remoting from the context of a
hyper V host to target Hyper-V guest VMS so you might know hopefully are
familiar with enter PS session where we can tap into a remote windows
server machine like you see here but notice that nowadays enter PS session
besides having a computer name, parameter,
there is also a VM name parameter and this is
supporting PowerShell direct scenarios.
The other way to do remote PowerShell is invoked command
and again we can do computer name or VM name in this
context if we're on the hyper V host,
if you want a persistent PowerShell remoting session,
we can create that with new PS session and pack it into a variable as you
see here and one neat thing about creating these persistent remoting
sessions is that you can reference those sessions and other commands like
to copy files within the session,
one computer to another or from the hyper V host to
the Hyper-V guest or vice versa.
Based on what,
you specify for path and destination here in this example using the copy item cmdlet