Windows PowerShell offers great remote features
through Windows Remote Management. Windows Remote Management is the
Microsoft implementation of the WS-Management console protocol, which
is a SOAP-based protocol designed as a common way for exchanging
management information between heterogeneous systems.
To run Windows PowerShell remotely, you need to
enable Windows Remote Management, which is included in Windows 7 and
Windows Server 2008 Release 2. Enabling Windows Remote Management
requires administrative privileges.
Figure 1 demonstrates running the Enable-PSRemoting
cmdlet to configure the computer to receive Windows PowerShell remote
commands that are sent using the WS-Management protocol. With this set
up, you can run Windows PowerShell commands remotely from a different
computer on the network.
Running SharePoint 2010 cmdlets in a remote session also has two additional implications that you must consider:
Authentication
The Windows Remote Management (or WinRM, which is the “backbone” for
PowerShell remoting) supports a variety of authentication mechanisms,
from clear password-based to Kerberos. However, since many of the
SharePoint 2010 cmdlets communicate directly with the SQL server, they
require a means of securely delegating a user’s credentials from the
remote client through the SharePoint 2010 server and onto the backend
server (scenario commonly known as “double hop”). The authentication
protocol that does this best for WinRM is Microsoft’s Credential
Security Support Provider (CredSSP), which means it must be enabled for
you to be able to use SharePoint 2010 cmdlets and object model
remotely. You can enable CredSSP on the server using the following
command:
PS > Enable-WSManCredSSP -Role Server
It is also required to enable CredSSP on each client as demonstrated here:
PS > Enable-WSManCredSSP -role client -delegatecomputer
SPServer01.powershell.nu
Memory Limit
WinRM implements a set of quotas for remote users, designed to make the
service more robust and reliable. One of such quotas is the maximum
amount of memory that can be allocated to a remote shell, which by
default is set to 150MB. Now, some SharePoint 2010 cmdlets can
potentially use large amounts of memory (even with all the memory
management logic in place), which means they can fail if run in this
default configuration. If you run SharePoint 2010 cmdlets remotely you
should consider increasing the quota setting to at least 1000MB as
demonstrated here:
PS > Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000