1

I try to deploy SharePoint WSP projects using PowerShell Remoting.

See https://web.archive.org/web/20130625064821/https://sharepoint.stackexchange.com/questions/44880/powershell-remoting-sharepoint-2010-error

The suggested solution is to configure CredSSP for SharePoint.

But Microsoft says:

Caution: Credential Security Service Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.

Ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-5.1

Not recommended in production environments.

Any suggestions for deploying using PowerShell Remoting and SharePoint ?

1
  • Kerberos delegation should work as well... Commented Sep 23 at 14:18

1 Answer 1

2

I only know of 2 methods for PowerShell Remoting in SharePoint 2010. You need to enable PSRemoting and CredSSP on both the client and server for these to happen. CredSSP is a requirement because there since SharePoint cmdlets call SQL, there will be a double hop.

  1. Connect to the SharePoint server and essentially execute remote commands on the sp10 server itself.
# Only need to do this part for initial setup for storage of username and pwd # and to turn on the Powershell remoting feature Enable-PSRemoting Enable-WSManCredSSP -Role client -DelegateComputer * Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File C:\crd-sharepoint.txt # Type Password Here # This needs to be executed before you can connect to the SharePoint farm/cmdlets $Pwd = Get-Content C:\crd-sharepoint.txt | ConvertTo-SecureString $Cred = New-Object -TypeName System.Management.Automation.PSCredential ` -ArgumentList "domain\username",$Pwd Enter-PSSession ` -ComputerName servername ` -Authentication CredSSP ` -Credential $Cred Add-PSSnapin Microsoft.SharePoint.Powershell 
  1. This will import all SharePoint 2010 Powershell Commands into a local session (Powershell Implicit Remoting).
# If you want to save credentials for an account (credentials need to be # specified using CredSSP Auth). Only need to run once Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File C:\crd-sharepoint.txt # Type Password Here # You could add this to a logon script to automatically import the sharepoint # powershell commands into your session $Pwd = Get-Content C:\crd-sharepoint.txt | ConvertTo-SecureString $Cred = New-Object ` -TypeName System.Management.Automation.PSCredential ` -ArgumentList "domain\username",$Pwd $Session = New-PSSession servername ` -Authentication CredSSP ` -Credential $Cred Invoke-Command $Session { Add-PSSnapin Microsoft.SharePoint.Powershell } Import-PSSession -Session $Session # This takes a minute or so to spin up so you could save it to disk. # This will NEED to be ran before running import-pssession Export-PSSession ` -Session $Session ` -OutputModule "SP2010" ` -CommandName *-SP* #Import Saved file from disk Import-Module SP2010 
1
  • Did you just delegate any computer using -DelegateComputer *? I would really recommend against that practice. Commented Sep 22 at 11:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.