How can I upgrade SharePoint sandbox solution on multiple sub sites without deactivate-activate feature on each sub site

Current I need to

  1. Deactivate feature from each sub site

  2. Deactivate solution from main site

  3. Upload a new solution and activate it

  4. Activate feature on each sub site.


In such case, you can create a PowerShell script. I am not having the exact code, but I used the following logic:

For First Time

  1. Add the Sandbox Solution using Add-SPUserSolution.
  2. Install the solution using Install-SPUserSolution.
  3. Now get solution ID using Get-SPUserSolution
  4. Next get all the features within solution using Get-SPFeature
  5. Check if feature is not enabled use Enable-SPFeature cmdlet to activate it.

When Updating

Simply run following commands:

  1. Using cmdlet Update-SPUserSolution you can update already activated sandbox solutions. The key point is -ToSolution parameter/attribute. Where you need to pass on the new Solution name. I used versioning in file name to overcome same solution identity conflict.
  2. Now you can repeat step 3 to 5 from above (in-case new features are added).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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