SharePoint Madness

All about SharePoint and Office365

Archive for the ‘SP2013’ Category

SharePoint 2013 Workflow – GOOD TO KNOW

Posted by Amit Bhatia on November 7, 2013


It’s been some time since I wrote my last blog post on “Missing Feature ID error while doing SharePoint 2010 CU patching”.

I have been working on SharePoint 2013 Workflows and found them to be an interesting tool to map the business process of organisations. In my analysis, I found that lot of developers and Tech Leads make wrong assumptions during the architecture, design and development of these workflow. Therefore, I am here to write on the best practices, similarity/dissimilarity between SharePoint 2010 and SharePoint 2013 workflows.

Best Practices to be followed for SP 2013 workflows:-

  • Workflow Design: Better to model a business process in a single workflow than to break the workflow logic into smaller workflows
  • Workflow Approval Action: Use “Stages” feature in the Approval action instead of creating multiple Approval actions
  • Reusable workflows should use Association Columns:  If you create a reusable workflow that relies on its list having a specific field,  you make the field an association column.
  • DO NOT use a user account for elevated privileges for impersonation : Use a generic account or neutral account for workflow impersonation actions
  • Variable Check: Check variables for non- null, correct data type and expected values to prevent errors
  • Use Trace Log for debugging: Use Trace Log effectively before the beginning and ending of a step to log into Trace logs for effective debugging
  • Write strings and variables to the history list by using the Log to History List action for debugging purposes

Things to remember:-

  • Workflow execution: Workflow execution engine now lives outside of SharePoint and resides in Windows Azure. The new workflow infrastructure introduces Workflow Manager Client 1.0 as the new workflow execution host. Whereas in previous versions workflow execution was hosted in SharePoint itself, this has changed in SharePoint 2013. Workflow Manager Client 1.0 is external to SharePoint and communicates using common protocols over the Windows Azure service bus, mediated by OAuth
  • Fully declarative Workflows: Workflow in 2013 is based on Windows Workflow foundation WF4 platform and is fully declarative. Workflows are no longer compiled into managed assemblies and deployed to an assembly cache. Instead, XAML files define your workflows and schedule their execution
  • Addition to the Workflow Object Model : Workflow Service Manager allow you to manage and control your workflows and their execution. The primary zones of interaction for the services manager are deployment, messaging, instance control, and interoperability with SharePoint 2010 workflows
  • Improved SharePoint Designer: SharePoint Designer can now create and deploy both SharePoint 2010 and SharePoint 2013 workflows. Visual Studio 2012 not only provides a designer surface for creating declarative workflows, but it can also create apps for SharePoint and solutions that fully integrate Workflow Manager Client 1.0 functionality
  • Workflow associations: Workflow associations (which are built on the WF concept of subscriptions) are the SharePoint infrastructure pieces that support Windows Azure to connect the infrastructure to customer data
  • Default Scope for SharePoint workflows:  SPList (list workflows) and SPWeb (Site Wirkflows) are the default scope supported by messaging infrastructure.  SharePoint 2013 does not support workflows that are scoped to a content type SPContentType
  • If a Workflow starts automatically on a repeatable event, it cannot start workflow of a given association until the existing instance of workflow association has completed running
  • SharePoint workflow Interop: SharePoint workflow interop enables SharePoint 2010 workflows (which are built on Windows Workflow Foundation 3) to be called from SharePoint 2013 workflows, which are based on Windows Workflow Foundation 4. This allows you to execute 2010 workflows from within 2013 workflows

I hope you would take the above points into consideration while designing and developing SharePoint 2013 workflows.

See you later.

Posted in SP2013, Workflows | 1 Comment »

16 Key facts on User Authentication methods in SharePoint 2013

Posted by Amit Bhatia on February 7, 2013

I have been working on planning the user authentication methods on SP 2013 and came across few facts which may prevent few headaches later while implementing the user authentication in SP 2013.

  1. Office Web Apps can be used only by SharePoint 2013 web applications that use claims-based authentication –  Office Web Apps rendering and editing will not work on SharePoint 2013 web applications that use classic mode authentication. If you migrate SharePoint 2010 web applications that use classic mode authentication to SharePoint 2013, you must migrate them to claims-based authentication to allow them to work with Office Web Apps.
  2. SharePoint 2013 also supports anonymous authentication – Users can access SharePoint content without validating their credentials. Anonymous authentication is disabled by default. You typically use anonymous authentication when you use SharePoint 2013 to publish content that does not require security and is available for all users, such as a public Internet website. In addition to enabling anonymous authentication, you must also configure anonymous access (permissions) on sites and site resources.
  3. In Forms based authentication, credentials are sent in plain-text format – You should not use forms based authentication unless you are using Secure Socket Layer (SSL) to encrypt the traffic.
  4. Active Directory Federation Services (AD FS) 2.0 is a SAML token-based authentication environment
  5. Kerberos authentication improves performance and page latency – Kerberos requires the least amount of network traffic to AD DS domain controllers. Kerberos can reduce page latency in certain scenarios, or increase the number of pages that a front-end web server can serve in certain scenarios. Kerberos can also reduce the load on domain controllers.
  6. Kerberos should not be used in internet facing deployments – Kerberos authentication requires client computer connectivity to a KDC and to an AD DS domain controller.
  7. In mutiple SAML based authentication providers scenario you can only use one token signing certificate in a farm – This is the certificate that you export from an IP-STS and then copy to one server in the farm and add it to the farm’s Trusted Root Authority list. Once you use this certificate to create an SPTrustedIdentityTokenIssuer, you cannot use it to create another one. To use the certificate to create a different SPTrustedIdentityTokenIssuer, you must delete the existing one first. Before you delete an existing one, you must disassociate it from all web applications that may be using it.
  8. No need for Single affinity in Load balanced Scenarios in SP 2013 – You no longer have to set network load balancing to single affinity when you are using claims-based authentication in SharePoint 2013
  9. People Picker search functionality does not work if the web application uses SAML based authentication – When a web application is configured to use SAML token-based authentication, the SPTrustedClaimProvider class does not provide search functionality to the People Picker control. Any text entered in the People Picker control will automatically be displayed as if it resolves, regardless of whether it is a valid user, group, or claim. If your SharePoint 2013 solution uses SAML token-based authentication, plan to create a custom claims provider that implements custom search and name resolution.
  10. Claims based authentication can have multiple authentication providers in a single zone
  11. Webapplication can only be created with Powershell for Classic mode in SP 2013
  12. Classic Mode authentication can only support one type of authentication per zone – Classic Mode only uses Windows authentication mode.
  13. Forms based and Windows based  authentication can only be used once in a multiple authentication method in a single zone
  14. Atleast one zone must be configured to use Crawl – Crawl component can only use NTLM based authentication. If NTLM authentication is not configured on the default zone, the crawl component can use a different zone that is configured to use NTLM authentication.
  15. Default zone should always be used for most secured settings –  The most secure authentication settings are designed for end-user access. End-users are most likely to access the default zone.
  16. Keep the zones to a minimum – Each zone requires an IIS website and adds overhead.

Posted in Authentication, SP2013 | Tagged: , , | 2 Comments »

Content Enrichment Service – For finer SharePoint 2013 Customization Search experience

Posted by Amit Bhatia on February 6, 2013

There has been some new features in SharePoint 2013 Search . So, this time I come up with a new topic on Content Enrichment Service and how it makes SharePoint 2013 search a pleasent experience.

What is a Content Enrichment web service?

Content enrichment web service callout in SharePoint 2013 enables developers to create an external web service to modify managed properties for crawled items during content processing. The ability to modify managed properties for items during content processing is helpful when performing tasks such as data cleansing, entity extraction, classification, and tagging.

Here are some examples of what you could do:

  • Create new refiners by extracting data.
  • Calculate new refiners based on managed property values.
  • Set the correct case for refinable managed properties.

Content Processing Engine

The content enrichment web service is a SOAP-based service that you can create to receive a callout from the web service client inside the content processing component. The content processing component receives crawled Properties from the crawler component and outputs managed properties to the index component. it is important to note that the web service callout can only read managed properties. Any crawled property value that the web service needs as input must first be mapped to a managed property. The web service callout can only access managed properties that exist before the web service callout, and not managed properties that are set further down in the flow. The web service callout can pass managed properties back to the flow, but only if they are a part of the Search schema.

In our example we have list of books with fields such as book title, author, written year, Publisher and other fields. The book title are not in proper casing as some of the items in the list have lower case titles and some titles have upper case titles.

Step 1: Create the web service

Here is a web service that read the books list and create some manged properties as refiners.

For a basic implementation, do the following:

  1. Include the Microsoft.Office.Server.Search.ContentProcessingEnrichment.dll located in C:\Program Files\Microsoft Office Servers\15.0\Search\Applications\External in your project as a reference.
  2. Implement IContentProcessingEnrichmentService as a web service.

using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Office.Server.Search.ContentProcessingEnrichment;
using Microsoft.Office.Server.Search.ContentProcessingEnrichment.PropertyTypes;
using System.Globalization;
using System.Threading;

namespace BookService

    public class BookService : IContentProcessingEnrichmentService
        // Define variables to hold the managed properties 

        private Property<string> newBookType = new Property<string>();
        private Property<DateTime> NewDateTimeBookModified= new Property<DateTime>();
        private readonly ProcessedItem processedItemHolder =
            new ProcessedItem
            ItemProperties = new List<AbstractProperty>()

        public ProcessedItem ProcessItem(Item item)
            // Iterate over all managed properties passed to the web service.
            foreach (var property in item.ItemProperties)
                var s = property as Property<string>;
                if (s != null)
                    CultureInfo cultureInfo =
                    TextInfo textInfo = cultureInfo.TextInfo;
                    string normalizedString = textInfo.ToTitleCase(s.Value.ToUpper());
                    s.Value = normalizedString;

                var l = property as Property<string>;
                if (l != null)
                    // The value of the new string managed property the
                    //  type of book.
                  newBookType.Name = “BookType”;
                 newBookType.value = “”; //get the book type value


                // Set the time for when the properties where added by the
                //  web service.
                NewDateTimeBookModified.Name = “ModifiedByBookType”;
                NewDateTimeBookModified.Value = DateTime.Now;
            return processedItemHolder;


Step 2:  Create new Managed properties that the web service populates

$mp = New-SPEnterpriseSearchMetadataManagedProperty
-SearchApplication $ssa
–Name “ModifiedByBookType”
–Type 1
–Queryable $True
$mp.Refinable = $True
$mp = New-SPEnterpriseSearchMetadataManagedProperty
-SearchApplication $ssa
–Name “BookType”
–Type 1
–Queryable $True
$mp.Refinable = $True

Step 2:  Crawl and Search the content.

Enable and configure the web service callout.

$config = New-SPEnterpriseSearchContentEnrichmentConfiguration

$config.Endpoint = “” //Add the endpoint for ex as http://localhost:712/BookService.svc for your web service.

$config.InputProperties = “Author”, “Title”, “Publisher”

$config.OutputProperties =  “Author”, “Title”, “Publisher”,

“ModifiedByBookType, “BookType”


-SearchApplication $ssa

-ContentEnrichmentConfiguration $config

Start a full crawl now of the Books List. In the refinement panel in the search center, enter the new managed properties and enter them as refiners. Save, Checkin and Publish the changes to the Refinement web part.

Now, you can set the filter for book type such as Book is “Fiction” and see the results:)

Here is the link to MSDN documentation on Content Enrichment Web Service for SP 2013.

Posted in SP2013 | Tagged: , , , | Leave a Comment »

Searching For Value

"Helping You Master the Game of Investing"

Ideas with Conviction

The best thing about investing is the ease with which you can move your capital across different businesses, helping you capitalize on every opportunity..

CFA Institute Enterprising Investor

Practical analysis for investment professionals

Journeys of a Bumbling Trader

Learnings and Thoughts on Trading, Macroeconomics, Value Investing, Quantitative Finance, and Accounting

Flirting with Models

Research Library of Newfound Research

Alpha Ideas

Investment Blog for the Indian Markets

Fundoo Professor

Thoughts of a teacher & practitioner of value investing and behavioral economics