SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems ( - Contact me direct: or call 704-873-8846 x704.

Search This Blog

Saturday, April 15, 2017

Getting the Web ID for a site (SharePoint & Online)

There's often a need to find the Web ID of a SharePoint site - specifically when exporting web parts (as shown in this article

NOTE: I don't take credit for these, these are a summary of what's out there!

So getting the ID can be done a number of ways - first, using the "API" (if using SharePoint Online, authenticate to the site first):


For Online:




Next using on premise PowerShell:

$site = Get-SPSite  http://<site & port>
$web = $site.AllWebs["<name of site>"]

In SharePoint Online using the SharePoint Online Management Shell:

Connect-SPOService -URL https://<org>

Enter your credentials, then enter:

Get-SPOSite -Identity https://<site>
Next connect to the site:

Connect-SPOSite -Url "https://<site>" -Credential "<>"

If you omit -Credential, you will be prompted (the credential is your EMAIL address <>, not the AD account domain\account) but better to use this:

$username = "<>"
$password = "<password>"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(ConvertTo-SecureString $password -AsPlainText -Force)
Connect-SPOSite -Url "https://<site>" -Credential $cred

Then finally for the top level web:

Get-SPOWeb -Identity "/"

For a subsite, use the name:

Get-SPOWeb -Identity "News"

Get-SPOWeb will list out details of the web - just look for the "Id" column.

Note - if using a Subsite under /Sites/, you have to connect to that site collection (instead of https://<site>, you use https://<site>".

Another way is through the URL. Open the site/web you want and open Site Settings. Click either the Site Content and Structure or Content and Structure Logs link. Click on the web in question and select the drop down then select General Settings - cut and paste the URL into notepad - you will find the ID in the query string after SPWeb (%3A = : - see here Here's snip of the URL where the SPWeb can be found:


Yet another is using jQuery - found on the MSDN site: 

<script language="javascript" src="" type="text/javascript"></script><script type="text/javascript">
function GetSPWebID()
        url = document.getElementById("field1").value;
        var webId;
 var soapEnv =
    "<?xml version='1.0' encoding='utf-8'?>\
  <soap:Envelope xmlns:xsi='' xmlns:xsd='' xmlns:soap=''>\
    <GetWeb xmlns=''>\
      url: url + "/_vti_bin/SiteData.asmx",
      beforeSend: function(xhr) {xhr.setRequestHeader("SOAPAction", "");},
      type: "POST",
      data: soapEnv,
      dataType: "xml",
      async: false,
      complete: function(xData, status) {webId = $(xData.responseXML).find('WebID').text();},
      contentType: "text/xml; charset='utf-8'"
}</script>Root Web URL: <input id="field1"/><br/>WebID: <input id="field2"/> <br/><br/><button onclick="GetSPWebID()">Get Web ID</button> 
//nonsense comment to keep IE7 from truncating MSDN code


SharePoint Online Workflows not working

Having had this problem and forgetting what I did to fix it, I did another search to find the answer so posting it here.

The issue is that though workflows publish correctly (i.e. no errors), they still do not fire (not sending email, not logging, etc.). In SharePoint Online, it turns out that a feature that SHOULD be enabled is not.

When this happens to you, navigate to the site where you are adding the workflow, click the Gear then select Site Settings. Find the Site Features (under Site Settings). Scroll to the bottom of the page and find the feature "Workflows can use app permissions" and activate it:


Wednesday, April 5, 2017

The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request

While I know Sandbox Solutions are going bye-bye, there are many on premise solutions where they are handy. However as some of you may have encountered, there are times when the error:

The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request

appears. There is a common post on this by Ricky Kirkham:

Having encountered this issue recently, I tried following his instructions to no avail. None of the solutions there worked. However I did come across another one that did:

This solution is shown as follows:

$uc = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$uc.WorkerProcessExecutionTimeout = 5000
$tier = $uc.Tiers[""]   # default Tier has no Name
$tier.MaximumWorkerProcesses = 2    # number of CPU Cores + 1

By default, the Timeout is set to 30 and the Worker Processes set to 1. The above obviously changes 30 to 5000 (5000 seems a little excessive if you ask me) and the number of processes to be Cores + 1 (i.e. 4 Core Machine = 5).

This does indeed fix the problem! However, on my 8 Core machine, I thought that 9 was a bit much (might impact performance) so I set it at 2500/4 and it still worked.

To check your current settings, do the following in the Command Shell:

$uc = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$tier = $uc.Tiers[""]   # default Tier has no Name
$timeOut = $uc.WorkerProcessExecutionTimeout 
$mWProc = $tier.MaximumWorkerProcesses

FYI: If you apply changes you MUST Stop and Restart the Sandbox service through Central Admin - a reboot will also fix if you are not in production.