Scripting Games Commentary: V – Remoting
In PowerShell we have a number of ways to perform actions on remote machines. Many of the scenarios in the Scripting Games introduced the need to perform some action on a remote machine.
Many of the solutions involved creating sessions, using invoke-command and then tearing down the sessions.
The problem is to get a few bits of information off the remote machine. Do you know PowerShell is installed on the remote machine? It isn’t installed on all the machines in my environment.
There is a quick remoting technique for situations like this. We don’t want to, or can’t, establish a remote session. Look at the cmdlets with a –ComputeName parameter. These can work with remote machines without needing to configure PowerShell remoting. Which cmdlets? Glad you asked.
PS> Get-Help * -Parameter Computer* | format-wide
All of these cmdlets can access remote machines directly. Use them rather than remoting for the simple jobs they were designed for.