0

i want to start a service "Microsoft SharePoint Foundation Sandboxed Code Service " by using the following power

$ServiceName = "Microsoft SharePoint Foundation Sandboxed Code Service"
Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Start-SPServiceInstance -confirm:$false > $null

The status is stuck in Starting for a hour which it seems not working. I have tried iisrest, restart window.

Is there any way to force stop it?

2 Answers 2

0

The alternative is to force the status update of the Service Instance. But it is also important to check the Windows Service, as the Sandbox Service has one.

$si = Get-SPServiceInstance -Server SERVERNAME | ?{$_.TypeName -match 'sandbox'}
$si.Status = 'Offline'
$si.Update()
0

The same way to stop it:

$ServiceName = "Microsoft SharePoint Foundation Sandboxed Code Service"

Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Stop-SPServiceInstance -confirm:$false > $null

After that, if you still can’t start this service, open the services window in server and check if the SharePoint User Code Host is running. And add the Service Account used for Microsoft SharePoint Foundation Sandboxed Code Service with Full Control rights.

References:

https://gallery.technet.microsoft.com/office/How-to-Start-Stop-the-8df0fd6d http://sharepoint.handsontek.net/2016/08/14/enable-sandbox-solutions-on-sharepoint-2016/

1
  • i granted the service account to local admin group. Don't know is this enough for your Full Control rights to execute the service.
    – king yau
    Feb 21, 2018 at 6:37

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.