Why is security so important?
We’ve seen that PowerShell is powerful, but we haven’t seen why it can be so dangerous. Everything we’ve done so far has required an interactive logon to the client we are using, which implies someone would need physical access to a device before attacking it. PowerShell, however, has the concept of PowerShell remoting, which allows us to log on to a remote device and run PowerShell code as if we were physically there. This is why it is such a powerful administration tool. We’ll not cover much about remoting in this book, as it is very much an admin tool, but it’s important to know the basics. Let’s take a closer look.
A PowerShell remoting whistlestop tour
Many older cmdlets in Windows PowerShell have a -ComputerName
parameter, which allows PowerShell to query a remote machine for information. The trouble with this parameter is that it relies on the credentials under which we are running our PowerShell session...