Skip to main content


Showing posts from June, 2014

SharePoint Search - Restrict result source to a single content type

Ever tried adding a result source in SharePoint to restrict your results to a single content type?
The query builder makes it sound easy by giving you options to add a simple filter ContentType "equals" "your content type".

Resutls? NONE returned.

Finally figured out that manually giving the contentype ID as "Contains starts with" > Manual value does the trick!

SharePoint 2013 workflow : The server was unable to process the request

Here, I received another SharePoint 2013 workflow error.
This time the workflow was not able to send emails and the following error was being shown

Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP Unauthorized to http://sitename/_vti_bin/client.svc/web/lists/getbyid(guid'guid') Correlation Id: id Instance Id: id

Fortunately I came across this post which gave me the answer

Solution 1:
In InetMgr, go to advanced settings for Security Token Service Application Pool and change "Load User Profile" to true. Recycle application pool.

Reason 2 and Solution 2 : There could be another reason for this error. The workflow authentication can fail if the user executing the workflow (this will be the user initiating the workflow) is given permission through active directory group and the container for t…

Change SharePoint site regional settings or culture info

Here is a quick script to change the regional settings for your sharepoint site.

function ChangeSiteCultureInfo() { [CmdletBinding()] Param( [Parameter(Mandatory=$True, ValueFromPipeline=$True)] [string]$spSiteUrl, [ValidateSet("en-AU","en")] [string]$culture = "en-AU" ) BEGIN {} PROCESS { Write-Host "Processing site $spSiteUrl" $spsite = Get-SPSite -Identity $spSiteUrl $rootWeb = $spsite.RootWeb $cultureInfo = [System.Globalization.CultureInfo]::GetCultureInfo($culture) Write-Host "Curent local setting is $($rootWeb.Locale) " $rootWeb.Locale = $culture $rootWeb.Update() $rootWeb.Dispose() $spsite.Dispose() Write-Host "Finished Updating the locale of $spSiteUrl to $cultureInfo" } END {} } Usage:
url_here | ChangeSiteCultureInfo

The option for the SharePoint 2013 workflow platform is not available because the workflow service is not configured on the server

I came across this scenario where I could not create a SharePoint 2013 designer workflow on just one of the site collection.

Turns out that it is an issue with the template used for creating the site and we need to enable a couple of hidden features to enable 2013 workflows.
Here is a code snippet to help you solve this issue.
function enableWorkflowHiddenFeatures() { [CmdletBinding()] Param( [Parameter(Mandatory=$True, ValueFromPipeline=$True)] [string]$spSiteUrl ) BEGIN {} PROCESS { try{ Enable-SPFeature -Identity WorkflowServiceStore –Url $spSiteUrl }catch{ Write-Host $_.Message -ForegroundColor Red } try{ Enable-SPFeature -Identity WorkflowTask –Url $spSiteUrl }catch{ Write-Host $_.Message -ForegroundColor Red } } END {} } enableWorkflowHiddenFeatures -spSiteUrl siteurl

Error Message : The option for the SharePoint 2013 w…

Download source code from TFS as a ZIP file

Tip : To get a clean download of the source code as a ZIP file from TFS, Just visit the web portal, right click on the project and select download as ZIP. Too easy.

Adding list item context menu to initiate workflow

It is very easy to add a list item context menu to initiate a SharePoint workflow
Use designer to add a custom action and you are done.

Why blog this? there are confusing blogs out there to try and build a url to do this!

SharePoint 2013 - Triggering list item changed workflow from another workflow.

Courtesy to one of my customers, I learned yet another tip for SharePoint 2013.

Scenario : You are developing workflows in SharePoint 2013
You have enabled the setting to trigger the workflow every time a list item is changed.
You have another workflow on the same list which makes a change to the list item.
You expect the item changed workflow to be triggered.

What happens:
2013 workflows are not triggered by changes made by other workflows.
2010 workflows can be triggered by changes made by other workflows.

Save SharePoint list attachments to a folder

Here is a powershell script to save SharePoint list attachments to a folder

Add-PsSnapin Microsoft.SharePoint.PowerShell function downloadListAttachments ( ){ [CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=1)] [string]$siteURL, [Parameter(Mandatory=$True)] [string]$listName, [string]$Path ) $tempLocation = $Path $w = Get-SPWeb $siteURL $l = $w.Lists[$listName] foreach ($listItem in $l.Items) { Write-Host " Content: " $listItem.ID $destinationfolder = $tempLocation if (!(Test-Path -path $destinationfolder)) { $dest = New-Item $destinationfolder -type directory } foreach ($attachment in $listItem.Attachments) { $attachment $file = $w.GetFile($listItem.Attachments.UrlPrefix + $attachment) $bytes = $fil…