Add a Sandboxed Solution to a Site Collection

Scenario/Problem: You need to add a sandboxed solution to a specific site collection.

Solution: Use the Add-SPUserSolution cmdlet.

Using the Add-SPUserSolution cmdlet adds a solution package (.wsp) to a site collection. All you need to provide the cmdlet is the actual location of the sandboxed solution package and the site collection, as shown in Listing 9.10.

Listing 9.10. Adding a Sandboxed Solution to a Site Collection

Add-SPUserSolution -LiteralPath "c:\SBSolution.wsp" -Site"http://intranet.sp2013.com/sites/UserSC"

The sandboxed solution package location is the -LiteralPath parameter, which is required. The path can be a local drive location or network location using a UNC string (\\servername\folder ...

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.