Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Posts Tagged ‘2013’

Claims Viewer Web Part – Installation

Posted by Jean Paul on June 17, 2016

In this article we can explore how to Download & Install the claims viewer web part for SharePoint 2013.


You can go the following location to get the web part:

From there choose the Downloads page:


You will get the WSP file.


The web part is Free for development & commercial use.


Once you have downloaded the WSP file, you need to install it. This is a Farm Solution so you require PowerShell.

Go to your SharePoint Server & Open the PowerShell window in Administrator mode.


You will get the following command window.


Run the following command to add the WSP package to Farm Solutions.

· Add-SPSolution “full path”

· Eg: Add-SPSolution “c:shared ClaimsViewerWebPart2013.wsp”

If things went well, you will get the following message.


Now run the following command to install the WSP package.

· Install-SPSoluiton ClaimsViewerWebPart2013.wsp –gacdeployment –webapplication http://yourserver

If things went well, you will the following output with no error messages.


Now you can come to your SharePoint site > Go to Site Collection features > Activate the following feature.


Once you have activated the feature, you can add the Web Part to a page.

Create a new page & choose the Insert web part option. You should be able to see the Claims web part as shown below.

Insert the web part & Save the page. You are ready to use the Claims Viewer web part.



Your claims may be different from the items shown above.



In this article we have explored how to install the Claims Viewer web part.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Claims Viewer Web Part

Posted by Jean Paul on June 5, 2016

In this article we can explore the Claims Viewer Web Part.

About Web Part

I was working in a Claims enabled SharePoint Web Application where I felt the need of a Claims Viewer component which could display the current claims of the logged-in user.


You can go the following location to get the web part:


An example is displayed below.


Web Part

The above component is developed as a Web Part and requires Farm Solution for deployment. The C# code runs in the server-side and renders the claims values to the output.


Following is the code which retrieves the claims.

protected void Page_Load(object sender, EventArgs e)


IClaimsPrincipal principal = Thread.CurrentPrincipal as IClaimsPrincipal;

IClaimsIdentity identity = principal.Identity as IClaimsIdentity;

IList<ClaimEntity> list = new List<ClaimEntity>();

foreach (Claim claim in identity.Claims)

list.Add(new ClaimEntity()


ClaimType = claim.ClaimType,

Value = claim.Value,

ValueType = claim.ValueType




Once the user is logged in, the thread will contain the Claims Principal object. We can get the Claims from this object.

Each claim will have the following:

· Claim Type which is the pre-defined URL eg:

· Claim Value which is the actual claim value eg: windowsadministrator

You can use the References for articles on Installation of the Claims Viewer web part.



In this article we have explored the usage of Claims Viewer web part.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

JSOM Batching Code Example

Posted by Jean Paul on November 12, 2015

In this article we can explore a sample JSOM code which will reveal the Batching advantage of JSOM.


Batching is one core advantage of JSOM over REST API. Batching minimizes the roundtrips involved by grouping all the queries together.

For example, if you have 10 SharePoint lists to be queried from a page, REST API requires 10 roundtrips which would be taking around 20 seconds. Here we can use JSOM to combine the requests into 1 roundtrip there by reducing the time to 2 seconds. (90% time reduction)


Network Roundtrip occupies the majority time involved in a web page loading.

JSOM Example

In this example we are using 2 lists named Contacts A and Contacts B. Please create these lists from template Contacts & add one item in each.



Now create a new page & add a content editor web part. Insert following code into it. Change the server URL before saving.

var siteUrl = ‘http://server‘;

$(document).ready(function () {

    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, “sp.js”);



function retrieveListItems() {

   var clientContext = new SP.ClientContext(siteUrl);

    var oList = clientContext.get_web().get_lists().getByTitle(‘Contacts A’);

    var camlQuery = new SP.CamlQuery();

    camlQuery.set_viewXml(” +


    this.collListItem = oList.getItems(camlQuery);


    var oList2 = clientContext.get_web().get_lists().getByTitle(‘Contacts B’);

    var camlQuery2 = new SP.CamlQuery();

    camlQuery.set_viewXml(” +


    this.collListItem2 = oList2.getItems(camlQuery2);


  clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));       


function onQuerySucceeded(sender, args) {

    var listItemInfo = ”;

    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {

        var oListItem = listItemEnumerator.get_current();

        listItemInfo += ‘nID: ‘ + oListItem.get_id() +

            ‘nTitle: ‘ + oListItem.get_item(‘Title’);



    var listItemInfo2 = ”;

    var listItemEnumerator2 = collListItem2.getEnumerator();

    while (listItemEnumerator2.moveNext()) {

        var oListItem2 = listItemEnumerator2.get_current();

        listItemInfo2 += ‘nID: ‘ + oListItem2.get_id() +

            ‘nTitle: ‘ + oListItem2.get_item(‘Title’);




function onQueryFailed(sender, args) {

    alert(‘Request failed. ‘ + args.get_message() + ‘n’ + args.get_stackTrace());


Testing the Code

Save and Refresh the page. You can see that the items from both lists are fetched.



You can see that the above message boxes shows items from 2 different lists. The code completed in one roundtrip instead of two.


REST is Chattier, but JSOM allows Batching.



In this article we have explored a JSOM batching example.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

SharePoint 2013 Virtual Machine

Posted by Jean Paul on September 10, 2015

You can find a pre-configured SharePoint 2013 Virtual Machine here.


Following is the download link:


Posted in SharePoint 2013 | Tagged: , , , | Leave a Comment »

Target Audiences of Web Parts

Posted by Jean Paul on August 27, 2015

In this article we can explore the Target Audiences property of web part. This is a less used property.


You have a list which has N number of web parts. You need to hide web few parts based on the user role.


How to achieve this?


You can use the property Target Audiences of web parts for this.


Please follow the steps below to experiment this feature. Create a new page & add 3 Image Viewer web parts into it.


Following are the 3 web parts.


Now add the above 3 images into Site Assets library and link them to the web parts.

Choose the Web Part > Edit Web Part > Advanced > Target Audiences Property to Site Owners, Site Members, Site Viewers groups respectively.


Save changes. Now refresh the page.


If you are in the Site Owners group, you will see the following web part alone.


If you are in the Site Members group, you will see the following web part alone.


If you are in the Site Visitors group, you will see the following web part alone.

This concludes our example with Target Audiences property.


Power Users can use the Edit Page option to roll back the Web Part property. So preferably this method should not be exposed to them.


In this article we have explored the Target Audiences property.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Indexed Columns to Improve List Performance

Posted by Jean Paul on May 20, 2015

In this article we can explore Indexed Columns which is a less-used feature in SharePoint.

Indexed Columns

Indexed Columns allows Indexing of List or Library columns. This enable the following advantages:

1. Increase speed of data retrieval

2. Improve Performance of large list or library

Indexing at list or library level will be applied to the database tables too. This helps in increasing retrieval speed especially used for the WHERE condition fields.

Improving Performance is required when the list view threshold has reached, for example a list with more than 5000 items.

Create Indexed Columns

To create indexed columns for a list or library do the following steps.

Open the List Settings Page.


Scroll down and click on the Indexed Columns link.


You will get the following page.


Click on the Create a new index link. You will get the following page.



Please note that SharePoint does not allow all column-types to be indexed. See references section for more information.

You can choose the column for indexing. For the time being, I have chosen Content Type.


The changes will be saved automatically.


You can add up to 20 indexed columns.

Database Index

If you have examined SharePoint Content Database Table structure, you will be knowing that SharePoint stores a record in multiple rows in the AllItems table. This table also contains record (items) from different lists. So you might have the concern:

Adding an Index can impact other List items too!

Explanation: This case won’t happen as once a column is indexed, the data will be stored in a new table. So whenever we are adding indexed-columns, a new database-column creation happens in the background. The new database-column will be indexed and thus provides better performance.



In this article we have explored Indexed Columns.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

SharePoint Server 2013 Search Features

Posted by Jean Paul on April 14, 2015

In this post we can quickly explore the SharePoint 2013 Search features for the Server edition.

Search by Metadata

Additional to Search by Content, SharePoint provides search on Enterprise keywords & Managed Metadata


Search Refiners provides quick filtering of search results using common properties. Search Refiners are displayed in the left pane of the search results page.

Query Suggestions

This feature provides automatic suggestions based on the query string.

Promoted Results

Search Administrator can promote results based on keywords.


Keyword Query Language provides advanced syntax & filtering for query construction.

Search Scopes

Search Scopes allows limiting the search content boundary within a site or site collection.

Search Verticals

Allows filtering of search results by:

1. Everything

2. People

3. Conversations

4. Videos

We can also create custom search verticals.

Result Sources

Result Sources allow to configure external content sources like another SharePoint site, External web site, Federated Bing search etc.

Document Preview

Document Preview allows previewing of Office documents within the search results.

Continuous Crawl

Continuous Crawl enables fresh content to appear in search results.

Display Templates

Allows custom formatting of search results.


In this article we have explored the Search features in SharePoint 2013 Server edition. I believe this will be serve as a quick-reference in SharePoint world.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

70-488 Create Content Type Event Receiver

Posted by Jean Paul on December 16, 2014

In this article we can explore how to create a content type event receiver.


We are using an existing content type of template type Contact. We are adding an event receiver which operates on the Item Add event. For time being, we are just using the event receiver to block the item adding with an error message.


Open Visual Studio and create a SharePoint 2013 Farm Solution.


Add a new Event Receiver as shown below.


Open the XML file and choose the template id as 105.


In the event handler code, use the following statements.


Now you are ready with the event receiver. Build & Deploy the project.


Testing the Event Receiver

Create a new Contacts list in SharePoint.


Try adding a new item & Save it. You should get the following error.


This concludes our simple example of using event receiver against content types. The above event receiver will fire for all the Contact content type instances.

You may wish to use advanced property manipulation based on your business scenario.


You can use SharePoint Manager a free tool for examining events for a content type. The tool is downloadable from:



In this article we have explored how to create an event receiver for a content type.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

SharePoint as a Document Management System

Posted by Jean Paul on November 25, 2014

I had a requirement of migrating Lotus Notes to SharePoint.  The main aspect of requirement was “Document Management”.

Following are the selling points of SharePoint against Lotus Notes.

User Interface

SharePoint provides an excellent user interface to add/update/delete/tag/search documents.


SharePoint provides document version.

Records Center

The records centers template provides quick solution to making historical records of documents.

Drag & Drop

Bulk document upload is supported in SharePoint 2013 using the drag & drop feature.


Explorer View

SharePoint supports WebDAV to enable Explorer View.  This helps people to operate in a much-known explorer fashion.


Shredded Storage

If your client document management involves heavy traffic, reduction in bandwidth usage & faster-updating can be achieved through Shredded Storage.

Remote BLOB Storage

SharePoint supports storing document content in database or external file systems.  This will relax the site collection size limits.

Content Indexing & Filters

By default SharePoint supports content-indexing of popular Office documents – Word, Excel, PowerPoint etc.  For custom filtering we can purchase & install 3rd party filters for PDF etc.


Following are the parameters we need to capture for the document migration.

  1. Number of documents in store
  2. Type of documents (word, excel, powerpoint, pdf , etc)
  3. Average size of documents
  4. Metadata requirement
  5. Content Type / Site Column requirement
  6. Version requirement
  7. Expected growth in an year
  8. Search requirement (full-text search, metadata-based)
  9. Records requirement (making document as a historical evidence)
  10. Site Template (blank, team site)
  11. Workflows requirement (approval, signature etc.)
  12. Document Governance (folders, metadata, mandatory fields)
  13. Type of user-authentication
  14. Permission roles, groups
  15. Preserving of system-values (created by, created date)
  16. Life cycle of a document (auto-archive, auto-delete, recycle-bin usage etc.)
  17. Policies around documents



In this post I have highlighted features of SharePoint as a Document Management System.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

When not to go for SharePoint Online?

Posted by Jean Paul on November 22, 2014

When not to go for SharePoint Online?

In this article I would like to share the scenarios where choose not to go for SharePoint Online.

Legal documents

If the client do not wanted to expose their documents over Internet, then obviously SharePoint Online won’t be a right fit for them.

Bandwidth Limits

If your client has bandwidth limits & policies coupled with big-sized document management, then going Online is not a good option.

(Workspace/Shredded Storage are alternative options though)

Offline Accessibility

If your client prefers more offline availability of the documents with easier Sync, then On-Premise would provide better flexibility.

(Groove is an alternative option though)

Connection Speed

On-Premise works better than Online if connection speed is a bottleneck.

Farm Solutions

SharePoint Online does not allow Full Trust/Farm Solutions.  If your project requires that old solutions to be migrated, then going Online would be restrictive.

(Microsoft Support provides a separate path for deploying Farm Solutions but will be process-oriented and you might get delayed with deployment & instrumentation)

Heavy Customization

If heavy customization & flexibility on master pages required then going Online can be restrictive.

The above scenarios restrict us to prescribe SharePoint On-Premise with/without a public-hosting.



In this article we have explored the cases for not going with SharePoint Online.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »