Latest Posts

SharePoint Interview Questions

Definition: (.WSP) is a SharePoint Solution Package file, which contains features, site definitions, assemblies and other deployable resources. You can use Visual Studio to create Solution Package file (.WSP).

SharePoint solutions are deployed to SharePoint server by using Solution package – (WSP) file. This file contains all the resources that need to be deployed on the SharePoint server. The place of each file on the server is decided by the properties in Visual Studio.

Definition: Feature stapling is the process by which you can add new functionalities to the existing site definition. So after feature stapling, when you create a new site using that site definition, the functionalities in the feature will be automatically available in the new site.

- You will need to create a farm solution for this implementation.

- Remember, you don’t need to change definition files (onet.xml) for this. You are just deploying one solution which will work according to the feature-scope selected.

- The feature will be activated by default only on the new sites, so you will have to manually activate the feature on old sites.

- As part of solution, you will need two features.

(1) The feature which will be activated by default or the feature with the new functionalities

(2) The feature which will be used to staple the first feature to the site definition.

You can go through step-by-step process for implementing Feature stapling in SharePoint

Definition: Zones are just different Logical Path (URL) to the same web application with different authentication methods.

If you want to present the same web application to different type of users using different URL and different authentication mechanism then you create a Zone or Extend an existing Web Application.

  • Each web application can have maximum 5 zones
    • Default
    • Intranet
    • Internet
    • Extranet
    • Custom
  • Each zone has its own IIS website
  • Each zone has a different URL configured
  • Blob and distributed cache can be configured differently for each zone
  • Each zone has its own port number and protocol (http/https)
  • As mentioned earlier, different authentication method can be applied to different zone. i.e. Forms Based Authentication in Internet and Windows authentication in default zone.
  • You cannot use the same zone again for the same web application. Like if you have created an Intranet zone for a web application, you cannot create an Intranet zone again for the same web application.
  • Each zone uses the same web application and same content, stored in the content database.

Full Crawl

Incremental Crawl

Continuous Crawl

Crawl all the content irrespective of previous crawls.

Crawls the content that was modified from last crawl

Crawls the content that was modified from last crawl but more periodically than incremental crawl

Parallel Full Crawl Not possible

Parallel Incremental Crawl Not possible

Multiple continuous crawls can perform simultaneously

Full Crawl works with content source - SharePoint Sites, Web sites, File Shares, Exchange Public Folders, Line of Business data, Custom Repository.

Incremental Crawl works with content source - SharePoint Sites, Web sites, File Shares, Exchange Public Folders, Line of Business data, Custom Repository.

Continuous crawl works only with content source type: SharePoint Sites

Full Crawl can be stopped or Paused in between the crawl process is running

Incremental Crawl can be stopped or Paused in between the crawl process is running

Once the continuous crawl is enabled, you cannot stop or pause it, you can only disable the crawl.

Definition: Continuous crawl is a content crawling mechanism in SharePoint that provides the most recent content in search results compared to Full or incremental crawl.  

Some Points:

  • By default, continuous crawl runs every 15 mins
  • Continuous crawl works only with content source type: SharePoint Sites
  • Multiple continuous crawls can perform simultaneously. So Even if the existing crawl is scanning a large update, another continuous crawl can start at a defined time and perform scan on rest of the updates.
  • Once the continuous crawl is enabled, you cannot stop or pause it, you can only disable the crawl.
  • You can change the continuous crawl interval only using Microsoft Power Shell.

Definition: User Information list is a hidden list in SharePoint which is available in all the site collections but is accessible to Site Collection Administrator only.

User Information List stores information like User Id, User Name, Email, Location, Designation, etc...

Whenever a user is granted access on Site Collection, an entry is created for that Active Directory user in User Information List (if the entry of the user is not already there.)

User Information list can be accessed by going to below path in Site Collection.

https://ServerName/SiteURL/ _catalogs/users/simple.aspx

 Claim based Authentication is the default type in SharePoint 2013.

SharePoint 2013 supports Claims Based Authentication as well as Classic Mode Authentication.

In SharePoint 2013, Classic Mode Authentication is deprecated and can be managed only by PowerShell.

Claim based Authentication is the default type in SharePoint 2013.

Following Claim Based Authentication methods are supported as part of user authentication in SharePoint 2013.

  • Windows Authentication
  • Forms-based Authentication
  • SAML token based Authentication

If we want to cancel event, we can do it only using synchronous event receivers like Item Adding, Item Deleting.

Initially in SharePoint 2010, we could cancel event using properties.cancel = true; in event receiver. But in SharePoint 2013, it is obsolete. 

In SharePoint 2013, we can write any of the below statements in Synchronous event receiver code of the event, to cancel the in-progress event.

properties.Status = SPEventReceiverStatus.CancelNoError

properties.Status = SPEventReceiverStatus.CancelWithError

properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl

SPWeb.EnsureUser method checks whether user is a valid user of the site or not. It checks user login name in Active Directory. If the user is valid, it adds the user to the site.

When the logged in user does not have sufficient permission to perform some task, then we can use SPSecurity.RunWithElevatedPrivileges code block to elevate the privilege in order to execute the code with higher permission.

When we run the code in SPSecurity.RunWithElevatedPrivileges code block, that particular code runs with App Pool Identity of the IIS website.

When we use RunWithElevatedPrivileges in code, it creates a new thread with Application Pool Identity and blocks the existing thread until it (new thread) finishes exeuting.

If you want to update content database (Update Site, Web, List, Library etc..), as a result of GET request, then you will have to set AllowUnsafeUpdate property to true. Microsoft has kept this property to protect site from cross site scripting attack.


Some Points:
FormDigest is a hidden control in page which checks POST request (modification to content DB) and it throws error if the request is invalid (e.g. A GET request doing modification to content DB is an invalid request). To bypass this validation, we need to set AllowUnsafeUpdate property to true.
• If you are updating content database using POST request, then just use SPUtility.ValidateFormDigest() in your code. It will validate the request and after that AllowUnsafeUpdate value will be set true by default. So if you are using POST request, you don’t need to use AllowUnsafeUpdate property.
• If application is running in an HTTPContext (webpart, application pages, etc, ... ) and request type is GET, you will not be able to modify the content DB. By default AllowUnsafeUpdate property value is false for GET request. To update content DB in GET request, you have to set AllowUnsafeUpdate property value to true.
• If you are using console application, where HTTPContext object is not available (as it is not a web request), you do not need to set AllowUnsafeUpdate property to update content DB. Its value is always set to true.

CSOM JSOM REST API
CSOM(Client Side Object Model) requires Microsoft.SharePoint.Client.Runtime.dll and Microsoft.SharePoint.Client.dll to interact with SharePoint JSOM(JavaScript Object Model) requires two main libraries sp.runtime.js and sp.js to interact with SharePoint REST API(Representational State Transfer) does not require any dll or JS library, as it is based on OData protocol, we can use REST API directly to interact with SharePoint
CSOM calls are Synchronous JSOM calls are Asynchronous REST API calls can be either Synchronous OR Asynchronous
When to use: 1)      Provide Hosted App (Add-in) 2)      .Net application that performs CRUD operation on SharePoint data 3)      Batch Processing 4)      conditional processing of code and exception handling 5)      Working with LINQ When to use: 1)      SharePoint Hosted App(Add-in) 2)      Html/JavaScript application that interacts with SharePoint 3)      Batch Processing When to use: 1)      SharePoint Hosted App(Add-in) 2)      A mobile app/any external system that interacts with SharePoint content
Master Page Page Layout
It is used to have consistent look and behaviour in your Site.
You can apply branding to the entire site using Master Page.
It is used to create template in your SharePoint site and you can create pages using that template to add content. This way you can manage consistent layout for the pages created using page layout
It does not require to activate Publishing feature to use Master Page It is part of SharePoint publishing feature. So when you use Publishing website (or activate Publishing feature), you can use page layout feature of SharePoint.
Master Page does not have content type so it does not store information Page Layout has content type associated with it so when a page is created using page layout, we can store content in content type’s field
SPListItem.Update() SPListItem.SystemUpdate()
New version gets created of the Item We can retain the same version of the item using this method
Modified and Modified By fields will be updated after using this method We can retain the value of Modified and Modified By columns
Syntax:
listItem.Update();

Syntax:
(1) listItem.SystemUpdate();

  • Updates list item without changing Modified and Modified By fields value
  • Version of the list item is NOT increased

(2) listItem.SystemUpdate(true);

  • Updates list item without changing Modified and Modified By fields value
  • Version of the list item is increased

(3) listItem.SystemUpdate(false);

  • Updates list item without changing Modified and Modified By fields value
  • Version of the list item is NOT increased  

NOTE: listItem.SystemUpdate() = listItem.SystemUpdate(false)

Before we go for differences, keep in mind below two definitions.

Host Web: The SharePoint Site where App is deployed and hosted is called Host Web 

App Web: The separate place other than Host Web where the resources/files (JavaScript, CSS, HTML files, etc...) are deployed is called App Web 

 

SharePoint Hosted App Provider Hosted App
In case of SharePoint hosted App, components are deployed on a subsite of Host Web called App Web. In case of Provider hosted app, components are deployed and hosted outside the SharePoint farm.
App components are hosted in isolated app domain of SharePoint farm SharePoint App is installed in Host Web but their components are deployed and hosted on the server and that server should not be in SharePoint farm.
App gets authorized by signed in user’s rights. App gets authorized by OAuth or cross-domain library to access SharePoint list, libraries and other components.
It supports programming in JavaScript and html. You cannot use server-side code You can use any scripting language until and unless it is supported by your web server or hosting service
Relatively they are easier to create and deploy Creation and deployment of Provider Hosted App is a bit complicated as compared to SharePoint Hosted App

Definition: ADFS is a software component created by Microsoft. It provides users Single Sign-on (SSO) facility to connect to different application across organization. That means even if you are accessing the application which is outside of your organization (domain), you will still be able to access it without providing your company credentials.

Intranet Site – No Issues:

When you log-in to your company computer using your credentials, and then if you try to open an Intranet site, you will not be prompted for credentials as it will check your logged-in identity in company AD. This is an easy implementation of SSO when you are accessing Intranet Site.

External Site – Challenge:

Now, challenge is to access any site which is outside your organization as you do not have entry in their AD.

ADFS Flow:

  1. User browses the URL provided by ADFS and user provides credentials
  2. ADFS checks authentication of the user in AD service of organization
  3. After authenticating, ADFS gives back user claim
  4. User sends claim via browser to target application
  5. Based on claim the output data will be presented to the user.

Definition: OAuth (Open Authorization) is an open standard for token-based Authorization.

In SharePoint view, OAuth allows users to authorize SharePoint, to provide access tokens to 3rd party Apps so that the 3rd party Apps can use the token to access content from SharePoint server without providing credentials.

Explanation:

  • Let’s say we have a 3rd Party app that reads data from SharePoint Application. But we must need to authorize the App before letting it access. So how do we do it? Answer is, using Authentication Server
  • Here, we have four things.
    • User – Logged In user
    • SharePoint Application/Content – Application on which user has logged on
    • 3rd Party App – App that needs to access data on SharePoint Application
    • Authentication Server – Used for authenticating Apps using OAuth token. In SharePoint Online, Authentication server must be AZURE ACCESS CONTROL SERVICE (ACS).
  • SharePoint application and 3rd Party App must establish TRUST with ACS.
  • Let’s see how they all function together.
  1. User arrives at SharePoint Application and authenticated using Claim based Authentication.
  2. Now, SharePoint has trust with ACS, so SharePoint will ask for Context Token for logged in user and the same will be returned by ACS.
  3. User will pass Context Token to Client App and Client App will pull Refresh Token out of it and pass it to ACS.
  4. Now, Client App has trust with ACS, so ACS will use the refresh token and send back the OAuth token to Client App.
  5. This OAuth token now can be used by Client App to access SharePoint content. OAuth token is issued for specific user, for specific resource and for specific duration.

Definition: AD DS is one of the main services provided in Active Directory (AD). Interactions of the users with any network resource are managed by AD DS. That means it is responsibility of AD DS to check the permission of the user, when the user logs into any network resource (computer, printer, network drive, etc...).

AD DS also provides method of storing Directory Data and making these data available to the users and administrators in the domain.

  • Microsoft products like, Exchange Server, Outlook, Skype, SharePoint Server rely on AD DS to provide resource access.
  • The server that hosts AD DS is called Domain Controller.

NOTE: Active Directory (AD) only stores the data and (AD DS) provides ways to manipulate and access data from AD. So AD is a storage system and AD DS is a service within AD that works around that storage system.

Definition: Active Directory is a database/application that stores information like, User Name, password, other user information (user email, role, address, office location, etc...) and perform Authentication and Authorization. Active Directory also stores information related to network drives, volumes, Printers, scanners, various servers, etc...

  • Whenever there is any change in user information like change in role, address, user leaving the company, etc... Active Directory needs to be updated by latest and accurate information. Most of the other system (Outlook, Skype, access on network resources) in company rely on Active Directory for latest data
  • Apart from storing individual user information, AD is also used to create and maintain Groups of users and assign them access rights within organization to access various network resources.
  • O365 also allows synchronization between Active Directory and online service. That means all the users and security groups available in AD are also available in O365.

Definition: Secure store service is an Authorization service that runs on SharePoint server.

It provides storage and mapping of Identity and Password of users. It also stores additional information in the fields that you define. These credentials are used to connect to the external system.

Stored credentials are mapped to the unattended service accounts (either single Identity or Group Identity). Secure Store Service provides support to store multiple set of identities for multiple back-end/external systems.

Some scenarios that utilise Secure Store Service while connecting to external data sources.

  • Excel Services
  • Visio Services
  • Performance Point Services
  • Power Pivot
  • Business Connectivity Services (BCS)

Some Guidelines: As the Secure Store Service stores sensitive information, it is better to consider a few things.

  • Run Secure Store Service in separate pool which is not used by any other service
  • Create a database for Secure Store Service on the separate SQL Server. Do not use the same server which is already used by Content Database
  • Take back-up of Generation Key and Secure Store Service Database

Definition: FAST Query Language (KQL) is used to form search criteria in SharePoint

FQL is structured query language which supports advanced query operators. FQL is used when you want to create complex queries programmatically.

Some Points:

  • FQL is not intended to be exposed to end users and it is disabled by default. To Enable FQL, use EnableFQL
  • FQL is used to form queries in SharePoint and most of the time they are used to form queries programmatically.
  • FQL has some more capabilities than KQL
  • FQL is a bit more difficult to execute using UI or any API. So most of the time developers prefer to construct and execute queries using KQL
  • The limit of FQL query is 2048 characters.

Definition: Keyword Query Language (KQL) is used to form search criteria in SharePoint.

KQL is the default query language for building search queries. Using KQL, search term or property restrictions are passed to search service.

Some Points:

  • If you create KQL from default SharePoint search front end, the length limit is 2048 characters
  • If you create KQL programmatically using Query Object Model, the default length limit is 4096 characters.
  • If KQL contains only operator or if KQL is empty, it is not a valid KQL.
  • KQL queries are NOT case-sensitive
  • KQL Operators are case-sensitive(UPPERCASE)

Definition:

OData(Open Data Protocol) is a standard that defines set of best practices for creating and consuming RESTful APIs.

  • OData uses HTTP protocol for CRUD operations(HTTP POST, HTTP GET, HTTP PUT,  HTTP DELETE)
  • OData uses URI for resource identification. That means you can select the content/data using the URI, g. to get SharePoint list object - http://SiteURL/_api/web/lists/getbytitle('ListName')
  • OData uses Atom XML or JSON format for response of the data
  • Why do we need OData? – There is so much content/data on different platforms and in different formats, there’s no any common way to access them and OData defines a common approach to access those data
  • Since SharePoint 2013, Microsoft has improved OData support in SharePoint. It supports full REST based interface so that developers can access (CRUD Operations) SharePoint content using REST API.

Response:

  • Response of OData request can be in Atom XML or JSON format
  • Generally Atom is used with managed clients and JSON is used with JavaScript/AJAX client
  • HTTP header of the REST request should contain the format specified otherwise Atom will be taken as it is default format of the response. 

Benefit:

  • We can make the SharePoint data available on non-Microsoft platform and mobile devices as well.
  • SharePoint can also connect and pull data from other OData sources.

Definition: 

Theme is used to apply new branding to you web site. It gives you easy and quick way to change the look and feel of your site in SharePoint.  

Some Points: 

  1. Themes are pre-designed collections of elements like color palette, font scheme, site layouts and background picture.
  2. You can apply theme to a site and preview the looks of the site before applying theme. 
  3. To access themes, go to, Site Settings >> click on Themes (Under Web Designer Galleries).
  4. Theme Gallery will open. You will find Font schemes (.spfontfiles) and color palette (.spcolor files). 
  5. Theme is created and used in the same site. It is not inherited in Subsite unless you are using publishing site. In publishing site, you can choose to inherit theme from Parent site.

Definition: CAML - Collaborative Application Markup Language: is an XML based markup language used in SharePoint to define Fields, Views, Templates, Forms, etc. used in SharePoint Sites and Lists.  

Mostly developers use CAML to query and fetch records from list and libraries. 

 

CAML is case-sensitive so make sure while Defining or Querying using CAML.

There are some free tools available to build CAML query. Developers can utilize them to construct query and use them in their projects.

Below are the scopes of a Feature. A Feature can be deployed at below mentioned levels

  • Farm Level:
    • The feature at this level can affect the entire farm.
    • The feature can be activated at farm level from Central Administration >> System Settings >> Manage Farm Features
  • Web Application Level:
    • The feature at this level can affect single Web Application only.
    • The feature can be activated at web application level from Central Administration >> Application Management >> Manage Web Applications >> Select a Web Application >> Click on Manage Features from Ribbon

  • Site Collection Level:
    • The feature at this level can affect entire site collection.
    • The feature can be activated at site collection level from Site Settings >> Site Collection Administration >> Site Collection Features

  • Site Level:
    • The feature at this level can affect only a single site.
    • The feature can be activated at site level from Site Settings >> Site Actions >> Manage Site Features
Site Definition Site Template
A Site Definition is the main structure of a site, including how it looks, what default lists are there, what default features are activated, navigation structure, etc... Site Template is created from an existing site. When a user customizes a site, template consists of the difference between original site definition and changes made to the site.
Site definition files are placed in WFE  Site template is stored in Content Database and can be seen in solution gallery
It is the core structure and not dependent on Site Template Site template is created using one of the site definitions only, so if the site definition is modified or deleted, custom template will not work 
Customization of site definition is a bit difficult. Site templates are easy to create and customize.
Require admin access on WFE for deploying site definition. Site owner can deploy the site template.
Data/files/content is stored on web server, so performance is better. Templates are in content database so they are less efficient compared to site definition.
CAML LINQ
If there is any issue in query, we will come to know at runtime. So, until we run the query, we will not know the issue in the query If there is any issue in the query, we will come to know at compile time only. So, we don’t need to wait till we run the query.
It is faster than LINQ. LINQ queries are first translated to CAML queries, adding one step more before query execution. So, it is comparatively slower than CAML.
Comparatively it is difficult to create a CAML query when using single or multiple lists. It provides strongly typed objects to design query so it is comparatively easier to form a query using single or multiple lists.
The results are placed in SPListItem Collection object, which is not strongly typed object. The results are strongly typed objects so Items and Fields provide compile time checking.
ExecuteQuery ExecuteQueryAsync
In ClientContext.ExecuteQuery method, operation will be executed synchronously.    In ClientContext.ExecuteQueryAsync method, operation will be executed asynchronously.
The current thread will wait till it gets response from server before continuing.  The current thread will not wait till it gets response from server. 
This is helpful when you want to conditionally execute the next steps based on response from server. You specify callback methods to catch the response from the server.
ExecuteQuery method is used in server object model ExecuteQueryAsync is used in ECMA script object model
Syntax: ClientContext.ExecuteQuery() Syntax: ExecuteQueryAsync(callback success,callback failure)

Here there are two callback parameters.
1)    For success
2)    For Failure 
Event Receivers Workflows
Cannot be initiated manually Can be initiated either manually or automatically
Event receivers can be either Synchronous or Asynchronous Workflows are always asynchronous, i.e. workflows get executed after the action/operation
User interaction is not possible in event receivers You can use various forms like initiation form, association form for user interaction.  
You can cancel running synchronous(before committing to Content Database) event receiver You cannot cancel workflow action as the change is already made in Content Database(workflow = always asynchronous)
Can be created only in Visual Studio Can be created using Visual Studio, Visio or SharePoint Designer
Event receivers execute on WFE, so if WFE reboots, event receiver may end abruptly without complete execution. Workflows are robust, can continue after WFE reboots. 
Event receivers run for very short period of time Workflows can run for days, weeks, months or even for years!!
Synchronous Event Receivers Asynchronous Event Receivers
They are known as ‘Before’ events They are known as ‘After’ events
Synchronous event receivers are called before the actual event occurs and before SharePoint has written any content in Content Database, that’s why they are called before events Asynchronous event receivers are called after the actual event occurs and after SharePoint has written content in Content Database, that’s why they are called after events
Events ending with “–ing” are named synchronous events. E.g. Item Adding, Item Deleting Events ending with “–ed” are named asynchronous events. E.g. Item Added, Item Deleted
Event is executed in the same thread as the triggering action is running. Event is executed in different thread than the triggering action.
You can cancel the running event  You cannot cancel the running event
You can get HttpContext You cannot get HttpContext 
You can display error message You cannot display error message 
Load LoadQuery
Load method populates the data whatever it gets from the server. LoadQuery method populates the data in completely new object of the type – IEnumerable 
In-place load: Result is loaded in ClientContext itself. Below is the example for the same Query-able Load: Result is NOT loaded in ClientContext. Result is completely a new object of the type IEnumerable.
Below is the example for the same
Example:
Var Lists = ClientContext.Web.Lists;
ClientContext.Load(List);
ClientContext.ExecuteQuery();
Example:
IEnumerable ListCollection = ClientContext. LoadQuery (ClientContext.Web.Lists);
ClientContext.ExecuteQuery();
As the object is loaded into ClientContext, it will be eligible for Garbage Collection only when that ClientContext is out of scope.   The result is loaded in completely new object (IEnumerable ListCollection in above example), so it will be available for Garbage Collection as soon as IEnumerable object goes out of scope.
SharePoint On-premises SharePoint Online
Environment Comparisons
SharePoint farm is in Organization’s own premise. SharePoint sites are in the Microsoft Data Centre (MDC).
Organization’s IT and support team manages patches and upgrades. Microsoft itself applies patches and upgrades
On-premise has version numbers: SharePoint 2013, SharePoint 2016, etc... Online Does not have a version number
Information/Data/Content is stored in Organization’s own servers. Can be the option for strict data privacy requirement.  Information/Data/Content is stored in cloud
Organization has full control over the servers, hardware and entire infrastructure. Microsoft owns data centres. Organization doesn’t have any control over the servers.
Organization has the responsibility to keep the “Uptime” of the server as it is managed by the organization itself. SLA with Microsoft of 99.9% availability
Feature Comparisons
Need to purchase and maintain Hardware. Software licenses need to purchase. Annual Subscriptions for Office 365 are billed on per user basis
Full support for server side and client side code Full support for client side code. Very limited support for server side code
Full Trust code can be deployed Full trust code cannot be deployed
Features with farm and web application level can also be deployed Maximum scope of feature deployment is site collection level.
For storage, devices can be expensive. Also the extension of the storage limit can cost Organization more and as the data grows, Organization will need to keep adding storage limits causing more expense to Organization. Storage cost is cheap. Cost may vary according to the selection of plan to be purchased. 
Fully Customizable as the entire control is with organization. Limited customization as the server controls are with Microsoft.
Full access on windows and SQL servers No server access is given to the users.
Farm Solution Sandboxed solution
It is deployed on SharePoint server in solution store It is deployed on Site collection level in Solution gallery
Hosted in IIS worker process(W3WP.exe)  Hosted in SharePoint user code solution worker process(SPUCWorkerProcess.exe)
To debug, attach debugger to W3WP process, running the current site To debug, attach debugger to SPUCWorkerProcess process
IIS pool recycles when new feature/package is installed Not mandatory to recycle SPUCWorkerProcess process when new version of code is installed
The deployed code can affect the entire Farm The deployed code can only affect site collection
It supports all the features and functionalities as long as it is achievable using SharePoint server side object model or any other supported API. Do not support following features and functionalities

(1) Application pages
(2) Farm scoped features
(3) Web Application scoped features
(4) Workflow with code
(5) Cannot access resources from the server
Mapped folders can be added in the project Mapped folders cannot be added in the project
Can connect and access external database and web services Cannot access external database or connect to external web services
Farm solutions are installed >> deployed >> and features are activated for code to work Sandboxed solutions are uploaded to solution gallery >> and Activated for code to work
Only Farm Administrator can deploy the code package Need at least Site collection Administrator access to deploy the code package
  • BDC - Business Data Catalog (Connectivity) was used in MOSS 2007. One can say BCS is extension of BDC.
    • BDC provides connectivity to the external data source.
    • Using BDC, you can perform Read operation on data.
  • BCS - Business Connectivity Services is used in SharePoint 2010, SharePoint 2013, and SharePoint 2019.
    • Using BCS, you can perform Create, Read, Update, Delete and Query(CRUDQ) operations on external data
  • Both BDC and BCS have built in support to provide connectivity to following kind of data sources.
    • Databases
    • Windows Communication Foundation (WCF) and Web services
    • Microsoft .NET Framework assemblies
Web Application Site Collection Site(Sub Site)
Web Application is an IIS web site and it is on top position in SharePoint structure/hierarchy. Site Collection, as the name means, is a collection of one or more sites. A Site collection will at least have one top level site and optionally sub sites created under that site. Site is the component that contains the actual content like web parts, list, libraries, calendar, pages, etc...
While programming, SPWebApplication class represents Web Application.  While programming, SPSite class represents Site Collection. While programming, SPWeb class represents Site.
A Web Application can have multiple Content Databases 1) Per Site Collection, you can have maximum one Content Database.

Explanation: You can add multiple Content Databases in Web Application and while creating Site collection, use different Content Database in different Site Collection.

2) Multiple Site Collections can have one Content Database.

Explanation: You can have only one Content Database for Web Application and use the same while creating the Site Collections.
We cannot create separate Content Database for sub site. Content created in site goes to Site Collection Content Database only.

Below is the hierarchy of Web Application, Site Collection and Site.

Hierarchy:

  • WebApplication
    • Site Collection
      • Site (Sub Site)
SharePoint List Document Library
Can have more than one documents attached to the list item Does not have document as an attachment instead it stores the document in library as an item
Only major version is supported  Major(Published) and minor(draft) versioning is supported
Do not support check-In/Check-Out feature Supports check-In/Check-Out feature
Documents added as attachment are not included in Search index/result Documents in library are included in search results
Attachment document in list item will not work with eDiscovery feature  Documents in library will work with eDiscovery feature
Cannot enable location based default value in list Can enable location based default value in document library
Cannot have document set Can have document set

Definition: Shredded Storage is a feature in SharePoint that splits the Binary Large Objects (BLOB) into smaller pieces/chunks.

When Shredded Storage is enabled, every document including the changes made to the document is stored as chunks in SQL server. When a user updates the file, only the affected chunk gets updated in SQL database instead of saving the entire document every time it is modified.

Some Points:

  1. Shredded storage is ON by default
  2. BLOBs are NOT shredded when you upgrade from SharePoint 2010 but shreds are generated when you upload or modify a document
  3. Shredded Storage feature can be enabled or disabled only on Web Application level. Below PowerShell can be used for the same. Basically we are not turning the feature off but we are increasing the size of single shred to as large as 1 GB. So it automatically eliminates most of the content from shredding in to pieces and will save the entire file.

$WA = GET-SPWEBAPPLICATION HTTP://<>>

$WA.WEBSERVICE.FILEWRITECHUNKSIZE = 1073741824

$WA.WEBSERVICE.UPDATE()

  1. Content Save: In SharePoint 2010, if we make any change in the document (even in metadata), a new document is created. With Shredded storage feature in SharePoint 2013, it only stores the changes we have made to the document thus saving lots of storage in the database.
  2. Content Read: AS part of the feature, FILEREADCHUNKSIZE property was introduced which is associated with BLOB Cache. BLOB Cache provides HTTP range request support. So when user request for incremental read (incremental read = different version of the same-open file) of any file, only that incremental chunk is retrieved instead of entire file, saving lots of bandwidth over the network.
    NOTE: Incremental read may take lesser time but when you are requesting any file for the first time it may take more time as the document is shredded into pieces and it will take time to collect all those chunks and present to end user.

Definition: Minimal Download Strategy is a SharePoint feature that is used to optimize page rendering.

  • When user moves from one page to another page, it only downloads the changes between the two pages.
  • This feature reduces the amount of data browser needs to download while navigating between the pages.

How to activate MDS feature:

  • Go to Site Settings >> Manage site features
  • Activate feature - Minimal Download Strategy

Some Points:

  • You can identify MDS enabled site just by looking at the URL. All the pages in MDS enabled site will have “start.aspx” for rendering. The requested new page will have “#” before it.
  • If MDS is enabled, URL of the page looks like below. /_layouts/15/start.aspx#/SitePages/default.aspx
  • If MDS is not enabled, the page looks like below.
    /SitePages/defaut.aspx.
  • MDS will not work on publishing site.
  • Some of the SharePoint site templates like App, Blog, Community, Projects, Team and Wiki have the MDS feature activated by default.

Definition: Delegate Control is a custom functionality/control that can be placed in place of particular SharePoint functionality/control.

Some Points:

  1. We don’t need to change the existing functionality
  2. We don’t need to change the master page.
  3. We are creating our own functionality and replacing it with existing SharePoint functionality.

Delegate controls provided in SharePoint 2010:

  1. AdditionalPageHead: You can use this to inject scripts (JS, CSS, etc..) in the master page HTML Head Tags.
  2. GlobalNavigation: Top most control collection visible on page.
  3. GlobalSiteLink3: This delegate control is for two icons on the site. (1) I Like It (2) Tags & Notes
  4. GlobalDelegate2: SharePoint dashboard control
  5. GlobalDelegate0: You can change the top right section/menu. You can remove this space or add some more links to it.
  6. PublishingConsole: Server-side code for ribbon control is loaded using this delegate control. You can add you server actions in this control.
  7. TopNavigationDataSource: This control is for top navigation data source. You can use this control to change the default data source and load your own.
  8. SmallSearchInputBox: This control is for default small search box you see on the page.
  9. QuickLaunchDataSource: This control is for the data source of the left-hand side links panel. You can customize this to pass your own data source.
  10. TreeViewAndDataSource: This is different navigation other than quick launch and top navigation. You can pass your own data source here and render links accordingly.

 Delegate controls provided in SharePoint 2013:

  1. SuiteLinksDelegate: Delegate control to handle links (1) Newsfeed (2) SkyDrive (3) Sites. You can add your own link also.
  2. SuiteBarBrandingDelegate: This control is for top left side site logo and text.
  3. PromotedActions: This control is for empty space between SHARE and FOLLOW link on top right corner

How to use:

  1. To create new Delegate Control, we need to create a package using Visual Studio
  2. Go to Visual Studio >> New SharePoint Project >> Farm solution.
  3. Create user control and place your content/code in this user control. OOB control will be replaced by the content of this user control.
  4. Now we need to register the control using Feature element.
  5. We need to specify the control to use, Sequence Number and URL to the control or assembly as described below, in Feature element file.

<?xml version=""1.0"" encoding=""utf-8"" ?>

<Elements xmlns=""http://schemas.microsoft.com/sharepoint/"">

  <Control

            Id=""SmallSearchInputBox""

ControlClass=""Namespace of the control class""

ControlAssembly=""Fully qualified assembly name""

            Sequence=""100""                                                                  

            ControlSrc =""/templates/NewSearchcontrol.ascx""/>

</Elements>

Below are the parameters,

  • Id=""SmallSearchInputBox"": This is Delegate Control name you want to replace with your control.
  • ControlClass: (Optional) Namespace of the control class
  • ControlAssembly: (Optional) Fully qualified assembly name
  • Sequence=""100"": Type is Integer. Used for sequence number for the control. Control with the lowest sequence number is added to the tree.
  • ControlSrc: Relative URL of the .ascx file, that is control file
  1. We are done. Now, Build >> Deploy and activate the feature.
  2. You will be able to see that OOB control is replaced by the custom control.

Definition: Event Receiver enables us to apply custom code against any event/action on specific SharePoint object. Event Receiver is a method that is called when any triggering action occurs on specific SharePoint object.

Types of Event Receivers: There are two types of event receivers.

(1) Synchronous event receivers:

  • They are known as ‘Before’ events
  • Synchronous event receivers are called before the actual event occurs and before SharePoint has written any content in Content Database, that’s why they are called before events
  • Events ending with “–ing” are named synchronous events. E.g. Item Adding, Item Deleting
  • Event is executed in the same thread as the triggering action is running.
  • You can cancel the running event
  • You can get HttpContext
  • You can display error message

(2) Asynchronous event receivers:

  • They are known as ‘After’ events
  • Asynchronous event receivers are called after the actual event occurs and after SharePoint has written content in Content Database, that’s why they are called after events
  • Events ending with “–ed” are named asynchronous events. E.g. Item Added, Item Deleted
  • Event is executed in different thread than the triggering action.
  • You cannot cancel the running event
  • You cannot get HttpContext
  • You cannot display error message

Event Receivers Level: Below are the event receivers - execution levels

  • Site(Site Collection) Events
  • Web Events
  • List Events
  • List Field Events
  • Item Events
  • Feature Events
  • Email events

Definition: Timer Job is a process that runs periodically in background.

You can find the timer job from Central Administration >> Monitoring. You can check the status of the timer job from Check Job Status link.

Scenarios: Followings are some examples of real time business requirements.

  1. Send weekly emails to manager on every Friday before closing of the day
  2. Send daily status to client - every day at 6.00 PM
  3. Check the entire farm once every month and delete closed sites.

Periods: A SharePoint Timer job can be executed on one of the below schedules.

  1. Minute
  2. Hour
  3. Day
  4. Week
  5. Month
  6. Year
  7. One Time

Notes:

  1. You need to attach “OWSTimer.exe” process in order to debug the code.
  2. Timer Job will be deployed as “Farm Solution” only.
  3. Every time you change the code of Timer Job, you need to restart the SharePoint Timer Service from windows services (services.msc).

Definition:

Retention policy is the feature in SharePoint that can be utilized to retain the content for a specific period of time. After the retention period is over, content will be treated according to the policies set for that content.

Purpose of retention policy:

Everyday data is increasing rapidly and it is becoming very essential that we maintain good quality of data and delete old or non-relevant data from the site.

Strict governance is must for each site/list or library under which content of the site is reviewed periodically and retained or deleted as per the need.

To support this need,

SharePoint has introduced retention policies which periodically check the content and their retention/expiry policies and based on that, actions are applied on the content.

There are 4 places where you can set retention policies:

  1. Site Collection:
  • To set Site policy, go to Site Settings >> Site Policies (under Site Collection Administration)
  1. Content Type:
  • To set Content Type policy, go to Site Settings >> Site Content Types (under Web Designer Galleries) >> Information management policy settings
  1. List or library:
  • To set List or Library policy, go to Library Settings >> Information management policy settings
  • Click on Change Source
  • You will see two options for retention source.
  • Content Types: Uses retention schedules on site level content types. This will ensure that this library complies with the site's information policy.
  • Library and Folders: Define schedules on the library and its folders. Those schedules will be enforced regardless of any schedule defined on the content types
  1. Folder:
  • To set Folder level policy, go to Library Settings >> Information management policy settings
  • Click on Change Source
  • You will see two options for retention source. Select Library and Folder
  • You will see folder structure of your library on Left hand side of the page.
  • Select the folder that you want to set policy on.
  • Now, you can set the retention policy for the selected folder.

Definition: Content Type HUB is a Site Collection in SharePoint, where we create and manage content types and publish those content types to use in other web applications.

We can create content types in content type HUB and publish them to use in other web application. Creating content types in a central location (HUB) becomes very easy to manage and publish the content types.

Process to create HUB:

  • Create Web Application
  • Create a root Site Collection within web application using any template
  • Activate “Content Type Syndication HUB” feature from Site Settings >> Site Collection Features
  • Setup Manage Metadata Service Application from Central Administration
  • Create and Publish Content Types.
  • Run two Timer Jobs from Central Administration >> Monitoring
    (1) Content Type HUB
    (2) Content Type Subscriber – Run the Job of the Web Application which is going to receive content types)
  • Verify published content type. Go to “receiver” site collection >> Site Settings >> Site Content Types

Definition: Content Type is a group of columns, settings, workflow, behaviour that can be reused in SharePoint list or Document Library.

Process to create and use Content Type:

  • Go to Site Settings >> Site Content Types
  • Create Site Content Type
  • Add existing columns or create new columns and add them to the content type
  • Go to your SharePoint list or library.
  • Go to List Settings >> Advance Settings
  • Allow management of content types – Set it to “true” >> click “ok”
  • Go to List Settings >> Click on “Add from existing site content types”
  • Add your content type in the list to use.

Why do we need it: Let us imagine a business situation. In our application we are keeping SharePoint lists of (1) Employees’leave plans (2) Employees’salaries records J (3) Employees’basic details. In all three lists, we need on or more columns (e.g. employee ID, employee name) from employees’basic details. Here, instead of creating these columns every time in list, we will create site columns and use those columns in site content type. Now we can use these content types in different list without creating those repeating columns again and again in each list.

Above situation is an example of reusability of metadata. Similarly we can define workflow at content type level and reuse them in list and library.

Definition: There may be situation when your feature is dependent on any other feature for functionality or data. In this situation, you can mark that other feature as dependency for your feature.

You can add other feature in your solution as dependency so that before activating your feature you can make sure that other feature is activated.

Add Dependency:

  • Open Project >> Open Feature in design mode
  • Expand the Feature Activation Dependencies node. Click on Add button
  • In the Add Feature Activation Dependencies dialog box, choose the Add a dependency on features in the solution option, choose the title of the feature that you want to add as a dependency, and then choose the Add button.
  • Add more than one feature by choosing multiple titles while pressing Ctrl

Add Custom Dependency:

  • Open Project >> Open Feature in design mode
  • Expand the Feature Activation Dependencies node. Click on Add button.
  • In the Add Feature Activation Dependencies dialog box, choose the Add a custom dependency option,
  • In Feature ID text box, enter the GUID of the feature that you want to mark as dependency.

Definition: In SharePoint, Feature is used to group SharePoint project items for easy deployment.

Feature can be activated and de-activated based on requirement and accordingly project items added in the feature, will be activated and de-activated from the scope it is deployed.

Create a Feature:

  • Go to Visual Studio
  • Create a SharePoint empty project >> Select – Deploy as a farm solution
  • Open the Feature file and add below feature properties.
  • Title: Enter title of the feature
  • Description: Enter the text which describes the feature
  • Scope: Specify the scope of the feature
  • Items in the Solution: Here you can find all the items that can be added in feature
  • Items in the Feature: Here you can find all the items that you are adding as part of feature

Below are the scopes of a Feature. A Feature can be deployed at below mentioned levels.

  • Farm Level:
  • Web Application Level:
  • Site Collection Level:
  • Site Level:
  • User Agent string contains the information of what type of device you are using to access the site.
  • User Agent string is different for different device and browser
  • If you are connected to internet, just type “what is my user agent” in browser to know your user agent string.
  • You can also get user agent string with JavaScript Command “navigator.userAgent”. Open browser >> Press F12(developer tools) >> go to console >> write command “navigator.userAgent” >> Enter. You will be given user agent string. You can use this value in device channel.

Definition: Image rendition is the feature in SharePoint, which can be used to create multiple instances of the same image with different dimensions (Height and Width).

Some points:

  • This feature is only available with Publishing SharePoint Site or SharePoint site with Publishing feature enabled.
  • If BLOB is not enabled, we cannot access Image Renditions.
  • To enable Blob Cache, Go to Web.config file of web application >> Search for “> Set attribute “enabled” to “true”.
  • Image Renditions can be created from Site Settings >> Look and Feel >> Image Renditions.
  • By default, there are some renditions created. You can modify or create new renditions by specifying Name, height and width.
  • After setting different renditions, you can upload images to Asset Library.
  • To find out different renditions of uploaded image, go to Asset Library where you have uploaded image >> click on menu/ellipsis (...) of the image >> click on Edit Renditions. You will be able to see all the renditions of that image.

How to use Rendition images:

One way:

  • Create a web part page and add a content editor web part in it.
  • Add Image using ribbon tool bar >> Select uploaded image, click on “Pick Rendition” from Ribbon >> Select the rendition you want to use or you can crop the image by clicking on last option - “Edit Renditions”.

Second way:

You can specify image rendition by either RenditionID or Width or Height parameter directly in image url like mentioned below.

  • Using RenditionId:

<img src=""/sites/testSite/Assets/space.jpg?RenditionID=5"" />

  • Using Width AND Height: If there are multiple renditions with same width or height, it is advisable to use both parameters in image url to specify the image

<img src=""/sites/testSite/Assets/space.jpg?Width=700&Height=300"" />

  • Using Width: we can use width as only parameter in image url if there is no any other rendition with same width

<img src=""/sites/testSite/Assets/space.jpg?Width=700"" />

  • Using Height: we can use height as only parameter in image url if there is no any other rendition with same height

<img src=""/sites/testSite/Assets/space.jpg?Height=300"" />

NOTE: If all the three parameters - RenditionId, Width and Height are specified in image url, then image will be picked by Rendition ID.

Definitions: Device Channel is a new feature in 2013, which enables the site content to render differently in different devices without changing the URL.

Some points:

  1. This feature is only available with SharePoint publishing sites.
  2. SharePoint Site Collection can support maximum 10 Device Channels only.
  3. A Device Channel can have maximum 150 Device Inclusion Rules.

Description:

  1. For this feature to work, we need to create Device Channel from Site settings >> Look and Feel >> Device Channel
  2. Enter User Agent String (Explained below) in “Device Inclusion Rules”. This value is used to identify the device from which the user is accessing the application.
  3. For different devices we can create different master pages with different styles, images, content styles.
  4. Each master page will be assigned a Device Channel. We can assign a Device Channel to Master page from Site Settings >> Look and Feel >> Master Page
  5. Based on User Agent string, browser can change the master page and render the content to the user.

User Agent String:

  1. User Agent string contains the information of what type of device you are using to access the site.
  2. User Agent string is different for different device and browser
  3. If you are connected to internet, just type “what is my user agent” in browser to know your user agent string.
  4. You can also get user agent string with JavaScript Command “navigator.userAgent”. Open browser >> Press F12 (developer tools) >> go to console >> write command “navigator.userAgent” >> Enter. You will be given user agent string. You can use this value in device channel.

Definition: Distributed Cache Service is a feature introduced by Microsoft in order to improve performance of SharePoint applications.

Some points:

  • Using this feature, frequently accessed content are cached and are easily retrieved from the server. This feature caches the data so that application doesn’t need to access database resulting in faster response.
  • Windows App Fabric is a pre-requisite for SharePoint and also for Distribute Cache Service to function properly.
  • Server, running Distributed Cache Service, is called Cache host. If one or more servers are running Distribute Cache Service then all such servers are together called Cache Cluster.

Distributed Cache Service can be deployed in two ways.

  1. Dedicated Mode: No other SharePoint service runs other than Distribute Cache Service. This is recommended approach.
  2. Collocated Mode: Distributed Service runs along with other SharePoint services on the server.

It is advisable not to run Distributed Cache Service on the server where a few heavy services are running like: Search, SQL Server, Project Server, Excel Services.

Distribute Cache service provides in-memory caching service to several features in SharePoint.

  • Newsfeeds
  • Authentication
  • OneNote client access
  • Security Trimming
  • Page load performance

Content Organizer: is a feature in SharePoint that can be used to move the documents/content from one common location to any other location (Site-collection/Site/Library/Folder within library) without manual user intervention. 

Drop off Library: After activating Content Organizer feature, one library (Drop off Library) gets created. This library is used to upload documents via manual uploads, workflows, the object model, etc. 

  • Any content that is received by the Drop off Library can be routed to alternate locations without user intervention. The location that the content is routed to is determined by rules and settings done in Content Organizer

Definition: Document set is a content type that can be used in a document library. You can keep collection of documents together as a single item and that is called a Document Set.

To enable document set in site collection, follow below mentioned steps.

  • Activate Document set feature at Site collection level
  • Go to a Document Library >> Enable Content Type
  • Now Click on “New Document” >> Document Set >> Specify New Document Set Name
  • Now you can add documents to this Document set.

Some points:

  • Welcome Page: Each document set comes with a welcome page which displays the document set metadata and files under the document set
  • Customize welcome page: You can modify the default page of the document set but the default page will be common to all the document sets in library. You cannot customize each document set welcome page differently.
  • Default Content: You can specify default content so that when you create new document set, the default content will automatically get created. E.g. if your company uses specific template for specific type of process, you can use predefined document template when you configure a Document Set Content Type.
  • Allowed Content Types: You can specify the content types, which can be used within Document set, when you configure a Document Set Content Type.
  • Workflows: (1) You can use standard Review and Approval workflow for the Document set, the entire Document set will get processed like a list item with the workflow steps. (2) You can also set workflow for individual document within Document set
  • Content Organizer: Document set can be used in Content Organizer for routing to different Site, Library or folder.
  • Version History: Version History can be captured of a document within Document Set

Definition: Audience targeting is a feature which helps to display the content/data (e.g. list, library, web part, links, etc...) to only specific group or Audience.

1. Below are the options of Audience

  • SharePoint Group
  • Distribution Lists(Can be created using Admin centre and it is used to add group and add user in to the group)
  • Security Groups
  • Global Audience (This is set using Manage Audience option in Office o365 and SharePoint server )

2. You can enable Target Audience on below options

  • SharePoint List or Library
  • List items
  • WebPart
  • Navigation Link

Global Assemble Cache (GAC) is the location where you store your global assembly (.dll) file.

Location of GAC: C:\Windows\assembly

For version of .Net Framework (4.0 or above): C:\Windows\Microsoft.NET\assembly 

To open the GAC: 

  • Go to start >> Run
  • Write: c:\windows\assembly\gac_msil

SharePoint Application Deployment:
You can deploy your solution either in Bin Directory or in GAC

  1. Bin directory:
  • Bin directory is a folder located in a root directory of the web application.
  • This is partial trust location and has a low level of Code Access Security (CAS) permissions. You can use web.config file of your Web application to change the CAS policy
  • Bin directory is specific to web application that makes it possible to isolate code to particular web application.
  • You cannot have multiple versions of the same dll in Bin directory 
  1. GAC:
  • GAC is the place where signed assemblies are kept.
  • Assemblies kept in GAC run with full trust by default.
  • They are globally installed so can be utilized in any web application.
  • You can have multiple versions of the same dll in GAC if versioning is enabled. 

Note:  Every SharePoint Farm solution is automatically registered in GAC. I would recommend (as part of Best Practices) not to deploy dll in GAC unless it is needed (In cases like Timer Job, Custom Work flows or any other solution that needs “Global” access to the assembly).

In simple terms, Microsoft SharePoint is web-based document management and collaboration platform that can be customized according to requirements.

As part of document management, you can create, edit, store documents in your SharePoint application and as part of collaboration you can share document within your workspace. You can also apply security policies on your documents to ensure it is shared to specific user groups only.

There’re many uses of SharePoint but on high level, SharePoint is used as a document management and Collaboration platform.

We value your Feedback:

Page URL:

Name:

 

Email:

 
 

Suggestion:

 

© 2024 Code SharePoint