SharePoint Online - Blocking Sandboxed Solutions that contain Custom Code

The SharePoint Online Management Shell has recently been updated.

This update includes the ability to Enable/Disable Sandboxed Solutions that contain Custom Code on a per-Site basis. As you may know Sandboxed Solutions that contain Custom Code have been deprecated.

To return the current settings for a Site run the following (replacing the Site URL). This will return either Disabled, Enabled or Unknown (which is the default setting)

Get-SPOSite "https://tenant.sharepoint.com/sites/testsite"  

To configure a Site to block the activation of Sandboxed Solutions that contain Custom Code run the following (replacing the Site URL)

Set-SPOSite "https://tenant.sharepoint.com/sites/testsite" -SandboxedCodeActivationCapability Disabled

Brendan Griffin - @brendankarl