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 (http://www.crwatersolutions.com) - Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Monday, May 22, 2017

Office 365/SharePoint Online Content Organizer

I noticed in early May 2017 that the SharePoint Online Content Organizer cannot reliably use "Send to" a different site.

Though the send to locations were correctly created in Admin > Records management and was heavily tested (and seemed to work), oddly the 'location' selection started to 'disappear' when attempting to create Content Rules.

This went from bad to worse when already established rules began failing - returning either 'an error has occurred' or worse, appearing to work but leaving the document(s) in the original Drop Off library.

I reported and demonstrated this multiple times to Microsoft - at this time, there is no fix available.

I will post if the issue is resolved or I get a definitive answer.



Office 365/SharePoint Online Information Management Policies

Be aware - as of early May 2017, the Information Management policies within SharePoint Online are NOT working. After multiple tests, a few things of note:

1) The job to process IM policies doesn't always run on a fixed schedule - I have seen posts where they believe it only runs once a week (!). However, in my testing, I found that to be off; in my tests it took over 2 weeks (approximately 15 days).

2) Issue has been reported to Microsoft.

3) Response from Microsoft - they broke it, not sure when it will be fixed and have disabled the functionality (however, it can still be set up in Online so they didn't disable the entire feature).

I'll post back if I ever hear back.

Using Start-SPAdminJob PowerShell (SP2013/SP2016)

It's great that they finally replaced the old stsadm command with PowerShell but they neglect to make it obvious to use.

When you run this (SharePoint Management Shell using Run as administrator of course), you might get an error as shown:


Kudos to Prasath Chellappan's blog - the issue is that the SharePoint Administration service is running. Use Run > services.msc (or go through Administrative Tools) and stop the service. Alternately you can do this on the command line using 'net stop SPAdminV4'.

When you re-issue the command, you'll see it working properly:


After the process has completed, you MAY not get a prompt back but once the banner message is gone, it has completed. Hit Return and the prompt should return.

Last, be sure to start the Administration service back up (i.e. through services.msc or net start SPAdminV4).



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 https://chuvash.eu/2014/09/19/export-any-web-part-from-a-sharepoint-page/).

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):

https://<site>/_api/web/id

For Online:

https://<site>.SharePoint.com/_api/web/id

subsite:

https://<site>.sharepoint.com/sites/subsitecoll/_api/web/id

Next using on premise PowerShell:

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

In SharePoint Online using the SharePoint Online Management Shell:

Connect-SPOService -URL https://<org>-admin.sharepoint.com

Enter your credentials, then enter:

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

Connect-SPOSite -Url "https://<site>.sharepoint.com/" -Credential "<someone@org.com>"

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

$username = "<someone@org.com>"
$password = "<password>"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(ConvertTo-SecureString $password -AsPlainText -Force)
Connect-SPOSite -Url "https://<site>.sharepoint.com/" -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>.SharePoint.com, you use https://<site>.SharePoint.com/sites/subcollection".

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 http://www.degraeve.com/reference/urlencoding.php). Here's snip of the URL where the SPWeb can be found:

FSmtContext%3DArea%3A%3FSPWeb%3A1b43b8ac-973e-4291-a268-fc9c0ecb4eb3%3A%26SmtContextExpanded%


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

<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" 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='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>\
    <soap:Body>\
    <GetWeb xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\
    </GetWeb>\
    </soap:Body>\
    </soap:Envelope>";
  $.ajax({
      url: url + "/_vti_bin/SiteData.asmx",
      beforeSend: function(xhr) {xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetWeb");},
      type: "POST",
      data: soapEnv,
      dataType: "xml",
      async: false,
      complete: function(xData, status) {webId = $(xData.responseXML).find('WebID').text();},
      contentType: "text/xml; charset='utf-8'"
    });
 document.getElementById("field2").value=webId;
}</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:

http://blogs.msdn.microsoft.com/sharepointdev/2011/02/08/error-the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request-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:

http://stackoverflow.com/questions/12293469/the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host

This solution is shown as follows:

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

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 
$timeOut
$mWProc = $tier.MaximumWorkerProcesses
$mWProc

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.

Friday, March 17, 2017

Content Types and Hidden Columns not available in List/Library

Came across a reminder the other day about using Content Types with Hidden Columns. As you may know, Hidden Columns do not show up in forms allowing you to use them for values that might be generated by a Workflow or similar.

In my case, I created a workflow that needs to set a 'Document Number', something other than just using ID, this one uses a list to keep track of the latest number. As a good practice, the definitions were setup as Content Types (in my case, 3 - 1 core and 2 that inherit from the core).

The need here is that a) the Document Number needs to be assigned by the workflow, b) visible in the List/Library Views and c) it isn't supposed to show up when adding/editing an item (i.e. so user cannot change).

So, one might think to simply set the field/column to Hidden up front and here's where the problem comes in.

If you set a column as Hidden, it does indeed appear in the content type but when the content type is added to a list/library, surprise! The column is not added, thus not available in the views - defeating the entire purpose.

The solution is a sloppy workaround but does work (you just need to document this!).

BEFORE adding the content type to the list/library, leave the field as Optional - this includes any content types that inherit from it.

NEXT add the content type(s) to the list/library - the column will appear. Set any views that you want, particularly those that need to display the column.

AFTERWARDS, go back to the Content Type(s) and set the column as hidden.

Once this is done, you will be able to use the column as you would have expected in the first place.

This problem has be a long standing one (past 4 years or more).

An extensive post on this (from back in 2013!):

https://paylord.wordpress.com/2013/11/18/content-types-and-hidden-columns/