Using PowerShell Remoting
In this recipe, we will use PowerShell Remoting to execute commands on a remote machine.
Getting ready
We first need to identify which remote machine we want to use. In our recipe, we will connect to a remote machine called ZERATULDC
from our client machine KERRIGAN
. These two machines are in the same domain.
Log in to ZERATULDC
, or to a machine you want to use for remoting. We need to enable PowerShell Remoting. Check out the system and permission requirements for running PowerShell Remoting from MSDN about_Remote_Requirements, available at http://msdn.microsoft.com/en-us/library/hh847859.aspx.
To turn on remoting, open up the PowerShell console using elevated privileges. Right-click on the PowerShell console and go to Run as Administrator. Execute the following command:
PS> Enable-PSRemoting
You will be prompted to confirm a couple of times. Answer A (or Yes to All) to these questions. Your screen should look similar to the following screenshot:
We also need to...