Using PowerShell remoting

In this recipe, we will use PowerShell remoting to execute commands on a remote machine.

Getting ready

To work with remoting in PowerShell, we first need to identify which remote machine we want to use. In this recipe, we will assume that there are two machines in the same domain that we can use.

Log in to the machine you want to use for remoting. We will refer to this as <Remote Machine Name>. PowerShell remoting needs to be enabled on this machine.

Note

Check out the system and permission requirements for running PowerShell remoting from MSDN about_Remote_Requirements (http://msdn.microsoft.com/en-us/library/hh847859.aspx).

To turn on remoting, open the PowerShell console in <Remote Machine Name> using elevated privileges. ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.