So what is PowerShell remoting?
Well if we were to sum this up,
it's a PowerShell feature that allows you as the
administrator to execute commands on remote systems.
So fairly straightforward really,
just I can connect from my workstation to something else.
Now from a PowerShell remoting perspective, how does this work?
Well, imagine that we have a local computer and then we have a remote computer.
On the local computer, there's a PowerShell executable called powershell.exe.
That process makes a connection out using WSMan, or HTTP,
which is the default for Windows 10,
and then it makes a connection out to the remote computer where it also
has an HTTP listener waiting for a request coming in.
It listens for that request, which is then tied to the WinRM service,
which we'll talk about, which is the Windows Remote Management service.
And then that is connected directly to the PowerShell
executable on that remote machine, which then will return a response back,
and then you end up with, effectively, like a VPN tunnel between two machines.
Not really a VPN tunnel, but the session is connected over specific protocols,
in this case HTTP, and then the commands can run from one to another.
Now PowerShell remoting itself allows us to connect to other machines,
but there are four things that it does for us.
It will manage the connection between the two,
it allows us to pass credentials, or authenticate
between the two or multiple machines,
it then allows us to execute those commands through
that tunnel that's now been created.
And then what's really special is it returns the
output from the remote machines.
So if I execute a command, for example,
that says get me the name of the computer,
and I run it from my workstation, which is called Liam,
and the other workstation is called Test,
when I execute the command through the session,
I will end up with it returning back Test, not Liam, because I executed the command remotely.