SharePoint: Increasing sandbox/solution execution timeout using Powershell

Poor sandbox solutions!
They have been great comrad in time of chaos where deploying a farm solution would take months. But these little saviour have be deprecated. This means that the functionality will still be available for use in SharePoint 2013, but primarily for backwards compatibility with existing solutions built using the sandbox solution approach.

First of all load the SharePoint powershell snap. To do that  we need to  run this command in the powershell command prompt just once.The command to load the SharePoint powershell snap in is as follows.

Add-PSSnapin Microsoft.SharePoint.Powershell

Then to check what is current status of the resource porting and time is:

Write-Host $uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit
Write-Host $uc.ResourceMeasures["CPUExecutionTime"].ResourcesPerPoint

Now run assign values to these attributes, run the following command:

$uc=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = 60
$uc.ResourceMeasures["CPUExecutionTime"].ResourcesPerPoint = 150
$uc.ResourceMeasures["CPUExecutionTime"].Update()
$uc.Update()


Now Launch PowerShell
PS> cd C:\my_path\ (enter)

Execute the script:

PS> .\run_import_script.ps1 (enter)

References:
Vaqar Hyder

E: vaqar.hyder3567@gmail.com

A:

Siebenbürgen Straße 2/1, Korntal-Münchingen, 70825, PK

Hire me on Freelancer.com

Comments

Popular posts from this blog

SPFx: Develop using SharePoint Framework without Installing all the dependecies.

SharePoint Online: Elevated Permissions....with love

Powershell: Filling up an Existing Excel Sheet with data from SQL Server