4

When executing Install-SPUserSolution powershell command the following error is shown:

Install-SPUserSolution : Sandboxed code execution request failed. At line:1 char:23 + Install-SPUserSolution <<<< -Identity some_package.wsp -Site http://localhost/sites/test + CategoryInfo : InvalidData: (Microsoft.Share...allUserSolution: SPCmdletInstallUserSolution) [Install-SPUserSolution], SPUserCodeExecu...F ailedException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletInstallU serSolution

When I try to activate the user solution from the SharePoint interface everything works fine. So this doesn't work only from PowerShell. I tried to run user code service under different account (admin account) but this didn't help. Currently this service is running under Network Service account.

Also when I run Add-SPUserSolution or Uninstall-SPUserSolution they work just fine. I was able to reproduce this issue on at least two servers. Please advice.

1 Answer 1

1

I had this same problem on a new SharePoint farm. The solution I was deploying worked in many other farms, so I knew it must be some type of configuration problem. It would deploy from the solution gallery in the browser, but not from PowerShell.

To get it to work, I did the following:

Created a new managed account.

Stopped the Windows service "SharePoint 2010 User Code Host". In the past I've had trouble with the service credentials being updated if the service is running.

Assigned the new managed account to "Windows Service - Microsoft SharePoint Foundation Sandboxed Code Service" and confirmed the Windows service was updated with the new credentials.

Confirmed the managed account was added to the local Windows group WSS_WPG. I also added it to:

  • WSS_ADMIN_WPG
  • Performance Log Users
  • Performance Monitor Users

In Central Admin "Manage Web Applications", confirmed managed account was added with "Full Control, Full Read" to User Policy settings for web application.

Rebooted the server.

1
  • Unfortunately still the same error. But I tested with the brand new wsp which has only content type definition and it worked using powershell. Then I added just an Event Receiver with all methods commented and the powershell failed. So probably there should be some attribute or something on the event receiver. What do you think? Dec 12, 2012 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.