So let's go into our environment, and we'll first look at how we enable
PowerShell Remoting, and we'll look at using WSMan first and the standard
Windows 10 defaults, and then we'll go through the SSH configuration for
both Windows 10 and also Linux. Our last task will be to review the Group
Policy creation for PowerShell Remoting for if we were wanting to send it to
multiple servers in our server farm. This is the Windows 10 administration
workstation.
This one, however, is connected to the domain,
so this is connected to our training network.
Now, when we want to configure PowerShell Remoting, there's a
couple of different ways that we can do this.
The first one is to use what's called WSMan,
which is the standard communication.
Now I'm going to launch here the Windows terminal. So, I've already
installed this here. I'm going to say Run as administrator.
Now just as a side note,
often it's really good to run it as administrator just
purely based on the fact that it won't, you know,
have any limitations on permissions.
So I'm going to make this a little bit bigger.
So, I'm logged into my PowerShell console. Now the first thing
that we can do is use a command called Set‑WSMan,
and then it will be QuickConfig. Now, let me just get rid of that,
Quick, and we can obviously tab through certain values if we need to,
so QuickConfig, and I can press Enter here.
Now when we press Enter at this point, we get the
option to see what it's going to do.
So when we run this specific command,
what it will do is go through and perform those five
specific tasks that are outlined.
It will check whether the WinRM service is running. It will then
set the service to make sure that when it reboots it starts
automatically. It will then create the listener so that we can
connect using that session,
then it will enable any of the firewall exceptions for the
communication, and then it will make sure that the
authentication services are running.
Now, I'm actually going to press no here because this is the training machine,
the actual client workstation.
What we're going to do is actually swap machines now, and
we'll connect to the Active Directory server.
So this is the Active Directory server.
We can see this by going to the Start menu,
Admin Tools, and you can see I've got Active Directory Users and Computers,
etc., and you'll see our domain training. Now what I want to
do is obviously enable PowerShell here.
So I'm going to go to the PowerShell option.
I'm going to right‑click here and choose Run as
administrator, or I can run the ISE.
For the purposes of this, I'm going to choose ISE and run it as administrator.
Going forward, I would make a recommendation that you would utilize
something like the Windows terminal instead of this.
Now the reason we do this is because I can write the script in
the top and see the execution in the bottom.
So let me, once again, go here, WSManQuickConfig, and then if I go here,
you'll see that I've got some various options available to me.
So the first one is to use SSL. This means instead of
creating the default HTTP connection, it will create an SSL connection.
Now we're not going to utilize that.
We also have another option called SkipNetworkProfileCheck. There's a 1
to 1 relationship between the type of the network that it's connected to,
as in what that machine sees it as, and you may have seen this at the
domain profiles where it's public, private, and internal, etc.
So you can check this option and say, actually, I
want to skip that profile check.
I can also come in, and I can use Force as well if I needed to. Now we'll just
use Set‑WSManQuickConfig. I'm going to execute this here,
select, and you'll see instead of it presenting it in
the window like we did a moment ago,
it props up a box. I'm going to choose yes, and it comes back
and says WinRM is already set up to receive requests. It's
already set for remote management.
So what did that do if I hadn't got it enabled?
Well, it would've gone through and configured all those components.
So, for example, if I just press the Start menu here and type firewall,
I can say check the firewall status here. I can then go to
Advanced settings at the firewall. And if I make this a little
bit bigger, we can scroll across,
go to Inbound Rules. And then what you'll see is you've
got a list of all the rules here.
If we scroll up and down,
you'll see that the Windows Remote Management pieces are now
enabled because as part of that process it enabled those. So,
you'll see that that's one of the components.
It will have enabled the services also.
So if I click the Start menu here and just type services,
go here, we'll expand this a little bit.
I'm going to put it in standard view,
make this a little bit bigger, and we'll scroll all the way down
to the bottom, and what you'll see is we're looking for the
Windows Remote, and there's our WS‑Management service, which is
automatically running as well.
So when you enable it using any of those options,
whether it's Set‑WSManQuickConfig or something else,
it will turn these on.
Now the other option is that we can actually say Enable‑PSRemoting.
Now when we look at the properties, you'll notice we get the same thing,
so Force and Skip, but if we execute just Enable, what you'll
see is this goes ahead and just automatically tries to configure
PS Remoting. This is the one that you would run on the client side, on the server side, depending on how you wanted to try and communicate.