So the next question is, why would you use PowerShell remoting?
Well, it's important to understand the benefits of PowerShell remoting.
The first one of these is that we get to execute single or
multiple commands against remote machines.
So we can simply say execute this single command, so, for example,
Get‑ComputerInfo, or we can say Get‑ComputerInfo,
do some interrogation,
update a registry entry, and then return some results back.
So we can run single or multiple via a single connection.
It also allows execution of either static commands, so I mentioned one earlier,
Get‑ComputerInfo, which will basically list me computer details. If you
were to run that on your Windows device right now, it would come back
with memory, storage, processor, name, etc.
I can run that command, which is a general PowerShell cmdlet, or I can
tell it to execute a custom script that I've written.
So maybe I took some of the regular commands, batched them altogether.
So, for example,
let's say I wanted to run a report every single week on
certain machines' disk space, for example,
I could run the static commands inside a PowerShell script and then
make it render out a nice HTML report, for example.
So instead of executing the static command,
I execute my script, which does all of that.
And, of course, our last benefit here is that we can execute
commands against multiple machines simultaneously.
So the idea here with PowerShell remoting is that I can say I want to
get, so I'll go back to our example of Get‑ComputerInfo,
I want to run that against my entire forest estate.
So let's say I have 100 servers,
I could in reality run Get‑ComputerInfo 100 times manually by
hopping onto each server, that's 100 connections, or I could simply
use PowerShell remoting and blast that out to a list of 100, and
then manage the outputs of them.
So really powerful benefits that come from being able to do PowerShell remoting when you're managing a server estate.