O'Reilly logo

Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 by Shannon Bray, Gary Lapointe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Execute Remote Commands

Now that you have your local and remote computers configured for Windows PowerShell Remoting, we can examine the different techniques for executing commands against the remote computer.

When it comes to executing commands against the remote computer, there are three different options available to us:

  • Execute commands one at a time using the Invoke-Command cmdlet.
  • Connect to a remote session and operate within that session using the Enter-PSSession cmdlet.
  • Import a remote session and operate on that session as though working locally using the Import-PSSession cmdlet.

Each of these three approaches has its own pros and cons. However, for reasons that will be made clear later in this chapter, we prefer the Enter-PSSession ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required