Interview Question and Answer – SharePoint 2013 , SharePoint 2016 and SharePoint Online

What does the content database handles in SharePoint?

The SharePoint database handles

  • Published reports
  • Reports models
  • Shared data sources
  • Properties
  • Resources
  • Permissions

Explain how to manage projects in SharePoint?

To manage projects SharePoint offers many facilities like

  • Dashboards: The dashboards consist of customs KPIs; reports and graphs give you status updates at a glance
  • Scheduling tools: Update and assign multi-level tasks from a Gantt view calendar
  • Personalization: Filter out projects and tasks that don’t affect your project
  • Resources: It is helpful in tracking cost, display availability and report of hours worked
  • Alerting: Keep team alert about various activities related to project and to remind about various important meeting and seminars

What query string element enables a client webpart to talk back to the parent?

1.Such communication is not allowed due to security
2.ParentId
3.OwnerId
4.SenderId

Answer: 4


What JavaScript library makes it possible to load SharePoint branding in Provider Hosted Apps?

1.ChromeControl.js
2.js
3.UI.Controls.js
4.Controls.js

Answer: 3


Which of the following is accurate?

1.The PFX cert is required by the App and the CER cert is needed by SharePoint
2.Both SharePoint and the App need the CER and PFX cert
3.The PFX cert is required by SharePoint and the CER cert is needed by the App
4.Both SharePoint and the App need the PFX cert

Answer: 1


How does SharePoint send context details to a SharePoint App?

1.Cookies
2.A Post request
3.Query String
4.None of these

Answer: 3


What query string element strips out the chrome of a SharePoint page?

1.IsDialog
2.Dialog
3.Dlg
4.IsDlg

Answer: 4

 


JavaScript Cross Domain calls in SharePoint need.

1.A Certificate and IssuerID
2.An AppWeb
3.CSOM
4.REST API

Answer: 2


How does a provider hosted app adopt the SharePoint page’s look and feel?

1.It uses the SharePoint master page
2.It uses the Chrome Control
3.This is not possible since the provider hosted app is a completely different app
4.You have to manually copy over SharePoint’s _layouts folder to the App

Answer: 2


The .app file is

1.A 7z file
2.A rar file
3.A zip file
4.A cab file

Answer: 3


Your SharePoint server is hosted on http://sp.yourcompany.com. Which of the following is an invalid App URL?

1.http://apps.sp.yourcompany.com
2.http://myapps.yourcompany.com
3.http://mycompanyapps.com
4.http://ws-949121A.yourcompany.com

Answer: 1


Every App needs an App Web

1.true
2.false

Answer: 2


Apps run on the SharePoint Server

1.false
2.True

Answer: 1


Which Powershell command do we use to generate and register an issuerid?

1.New-SPTrustedSecurityIssuerID
2.New-SPTrustedSecurityTokenIssuer
3.New-SPTrustedTokenIssuer
4.New-SPTrustedIssuerID

Answer: 2


Sandbox solutions in SharePoint 2013 are,

1.Encouraged to be used
2.Disabled completely
3.Deprecated
4.Still supported, but user code is deprecated

Answer: 4


What control allows a SharePoint Page to be shown in an IFRAME?

1.It is not possible to embed SharePoint pages in an IFRAME
2.WebPartPages:AllowFraming
3.No control is necessary, you can embed pages at will.
4.FramePages:WebPartPage

Answer: 2


Provider Hosted Apps have a predictable URL

1.false
2.true
3.true except for autohosted apps
4.false in all scenarios

Answer: 3


Custom editors for Client WebParts ..

1.Inherit from EditorPart
2.You cannot write custom editors
3.You can do limited editing capability using CAML
4.Client WebParts are not supposed to be edited

Answer: 3


In provider hosted apps, one Issuer ID can be setup for hosting multiple client s/apps?

1.True
2.False

Answer: 1


Which file Provider Hosted App Visual Studio project, makes developer work little bit easier? So, how do we authenticate our app to SharePoint? The underlying mechanics of that are somewhat complicated, so they visual studio made developer lives easier by giving us this file?

1.cs
2.xml
3.Config
4.xml

Answer: 1


SharePoint-hosted apps, they can work with FBA, but they can’t work with Claims, or ADFS, or Azure ACS?

1.True
2.False

Answer: 1


During development of Provider Hosted Apps, client ID generated is mentioned in two places?

1.xml, machine.config
2.xml and Web.config
3.xml and Manifest.xml
4.config and Machine.config

Answer: 2


What API do Apps use?

1.REST
2.CSOM
3.Server side API
4.REST and CSOM

Answer: 4


How can you create a ClientContext?

1.Using the constructor
2.By calling ClientContext.get_Current()
3.By calling ClientContext.Current
4.All of the above

Answer: 4


What is the preferred URL for REST API in SharePoint 2013?

1._api
2.svc
3./_vti_bin/_api
4./_vti_bin/listdata.svc

Answer: 1

 


What method in CSOM allows you to make a round trip to the server?

1.$.ajax
2.ExecuteQuery
3.$.get
4.$.getJSON

Answer: 2


Where will you find the necessary DLL references for a thick client CSOM client?

1.ISAPI folder
2.on MSDN
3.BIN folder
4.Layouts folder

Answer: 1


Which of the following requires a Form Digest?

1.DELETE
2.PUT
3.POST
4.All of the above

Answer: 4


Which one of the below helps in concurrency handling?

1.None of the above
2.Promises
3.Try Catch
4.Object Identity

Answer: 4


How does CSOM authenticate when not running as an App?

1.It is preauthenticated
2.It uses the user’s identity
3.It asks the user to enter a username/password
4.It works in anonymous mode

Answer: 2


What serialization formats are used with REST in SharePoint?

1.ATOM and JSON
2.JSON and OData
3.ATOM And OAuth
4.None of the above

Answer: 1


Which version of SharePoint was CSOM introduced in?

1.2013
2.2007
3.2010
4.2003

Answer: 3


How do you specify last-in-wins concurrency checks?

1.Don’t specify ETag
2.Set ETag to *
3.Set ETag to 0
4.Set Etag to “”

Answer: 2


What facility in REST API helps you deal with concurrency issues?

1.Object Context
2.client Context
3.$.get
4.eTAG support

Answer: 4

O365, SharePoint 2010, 2013, 2016: Updating List item by using JSOM

Applies to :

  • SharePoint Online – O365
  • SharePoint 2010
  • SharePoint 2013
  • SharePoint 2016

Below is the source code to update list item by using JSOM,

var CurrPageUrl;
var PageName;
var webUrl; 
var listName = "PageHitCounts";
var itemId = 1;
var tempPN;
var success = "success";
var failure = "failure";
var siteUrl="My Site URL";
var pagename;
var item;

$(document).ready(function() 
{
CurrPageUrl=window.location.href;
pagename =  CurrPageUrl.substring(CurrPageUrl.lastIndexOf("/") + 1, CurrPageUrl.lastIndexOf("."));
PageName = pagename;
ExecuteOrDelayUntilScriptLoaded(PageHitOnpageLoad, "sp.js");
 });
 function PageHitOnpageLoad()
 {
var clientContext = new SP.ClientContext.get_current();
var selectedItems = SP.ListOperation.Selection.getSelectedItems(clientContext);
     var oList = clientContext.get_web().get_lists().getByTitle("PageHitCounts");
         
     var camlQuery = new SP.CamlQuery();
     camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' + 
         '<Value Type=\'Number\'>1</Value></Geq></Where></Query></View>');
     this.collListItem = oList.getItems(camlQuery);
     clientContext.load(collListItem);
     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 += oListItem.get_item(PageName);
         var count = +listItemInfo + +1;
         oListItem.set_item(PageName, count);
         oListItem.update();
         clientContext.ExecuteQuery();
     }
}

function onQueryFailed(sender, args) 
{
  alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

Hope this help.

O365 and SharePoint: List of WebParts in all sites of Web Application by using PowerShell

As we aware the WebpartManager class is helpful in Server side object model. The question popped-up in my mind “Is this possible by using PowerShell scripting?“.

I found answer as “Yes”.

Below is the code snippet to achieve the same,

$oContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService;
[Microsoft.SharePoint.Administration.SPWebApplicationCollection]$waCollection = $oContentService.WebApplications;
$log = “.\results.txt” # output file name and path
$pagepath = “/default.aspx” # you can change page name or page path
“Site URL; WebPart Title ; Webpart ID” | out-file $log
$waCollection1 = $waCollection | where-object {$_.IsAdministrationWebApplication -eq $FALSE}
foreach ($wa in $waCollection1)
{
foreach ($obj in $wa.Sites)
{
write-host “Processing site: ” , $siteURL
$siteURL = $obj.URL

$site=new-object Microsoft.SharePoint.SPSite($siteURL)

$pageURL = $siteURL + $pagepath
$web=$site.Openweb()
$webpartmanager=$web.GetLimitedWebPartManager($pageURL, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
foreach ($webpart in $webpartmanager.WebParts)
{
$siteURL + “; ” + $webpart.Title + ” ; ” + $webpart.ID | out-file $log -append
}
}

SharePoint / Office 365 Migration: 7 – Important considerations

Migration

1. Take inventory

Migrations are like a journey into the unknown. Our best recommendation is to first make sure that you know what you are taking with you on this journey. This helps plan better to avoid common pitfalls and issues.

Getting a good idea of what is being migrated can be tricky. You may have lots of data accumulated over years and it may not be stored in a nice and structured way. Audit and analyse what data and files you have and in what format. Getting an idea of sizes is a good starter to understand the scope of the project.

Also it is a good idea to identify any special cases, regulatory requirements, security exceptions and files which don’t fit the normal 80% use cases. Being aware of these would empower you into better planning for your migrations.

 

2. House Keeping

Migrations are like moving home. You pack your stuff and move it elsewhere. However this is also a perfect opportunity to do some house keeping. You may not need some of the data and files you have accumulated over years. Some may be a perfect case for archiving. Then there is the case of duplicates. Identifying duplicates can be tricky but can be worth the effort. If done correctly, you can save some money my reducing your storage needs for the migration.

The biggest challenge is to find the correct owners of the data and get some approval on things which are not needed. That is always tricky. Also your business will have changed shape over years as it has evolved and this may be a good time to restructure some of the data organization to better reflect the shape of the organization going forward.

Another common tip to do at this stage is to think about data classification. Are there any tags you can apply to your files as additional metadata? E.g. Proposals, Quotes, Research Papers, Marketing Materials etc. You can also review security at this stage and decide if you want to add additional security classification to your files e.g. Confidential, Internal, Public. This will tremendously impact the findability of your data via logical data filtering and search.

 

3. Planning

Once you are armed with what you are taking with you on your journey and have better selected and restructured your files, you need to then consider where you are going. You need to draw up a migration plan on how you plan to get to your destination. You also need to consider how do you handle any special cases identified and how are you going to transform the data into a new restructured system.

Effective planning is the key to a successful migration. Perform some tests to get an idea of your migration speeds, network and system speeds to realistically get an idea of a timescale. Also consider how much impact a migration will have on your peak time load and if migrations will have to be done off peak hours to provide the quality of service needed for the day to day business activities.

 

4. Communication Plan

You are not alone on this journey into the unknown. You are steering the ship, however the whole organization is along with you on this journey. This step is vital for better user adoption of the new system. Create a communication plan on how you can effectively manage this change and inform your organization about it. I have seen a lot of people ignore this, however we consider this a very vital step to better user adoption.

 

5. Tools

Drag and drop migrations are rarely a reality. Due to the sheer volume of data in any migration project, key success relies on using automation. Consider using tools to help you with the various phases and take a lot of the pain away.Automate the inventory phase to get a good understanding of what you have.

The more detailed data you can get, the better your house keeping and planning will be. Finding duplicates can be a lot easy with a suitable tool. Automate the actual migration effort. These specialized migration tools can handle a lot of common issues and smoothen the process of moving the data over. We strongly recommend to use specialist tools to ensure a quick and smooth migration.

 

6. Testing

Test as much as possible. It is not physically practical to test every item, however along with manual testing, utilise some automated testing tools if possible to validate the migrations as much as possible. We utilise a bespoke tool at Toolagento add an additional layer of safety over manual testing. We cannot stress the importance of this phase more. This is a very vital phase as you don’t want to discover 6 months down the line that you are missing some data.

 

7. Cut over plan

Consider planning this very carefully. How do you plan to make the switch over to the live system. Are you going to go for a big bang migration or would gradual rollouts be good for you. How do you plan to synchronize the data, test it and get go live acceptance. Migrations are slow projects and can take days to complete. So having an effective cut over plan right from the start is really useful. This will ensure that you will have a relatively smooth transition instead of a bumpy ride.

Finally do not forget to celebrate when you have completed your migration, as you deserve it. Migrations are complicated projects and you deserve to pat yourself for steering the ship successfully across this journey.

O365 – SharePoint Online: Alpaca JS based Apps development

Introduction

This article is primarily intended for creating a simple Apps based on Alpaca JS framework for O365 SharePoint Online.

Alpaca Demo

Download Source Code

Click here for Source code 

What is Alpaca JS framework?

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.

Everything you need is provided out of the box. Alpaca comes pre-stocked with a large library of controls, templates, layouts and features to make rendering JSON-driven forms easy. It is designed around an extensible object-oriented pattern, allowing you to implement new controls, templates, I18N bundles and custom data persistence for your projects.

Alpaca is open-source and provided to you under the Apache 2.0 license. It is supported by Cloud CMS and is in use by organizations and within projects all around the world.

Steps to create the Alpaca based Apps for SharePoint Online

Step I

Create the HTML file by using the below source code,

<!DOCTYPE html>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head>

<title>User Details</title>
<meta charset=”utf-8″ />
http://code.jquery.com/jquery-1.11.1.min.js
http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.0/handlebars.js
<!– alpaca –>
<link type=”text/css” href=”http://code.cloudcms.com/alpaca/1.5.17/bootstrap/alpaca.min.css&#8221; rel=”stylesheet” />

<style>
form {
padding-left: 2%;
width: 60%;
}
</style>
</head>
<body>

$(function () {
$(“#form1”).alpaca({
“schema”: {
“title”: “User Details”,
“description”: “Fill User Details”,
“type”: “object”,
“properties”: {
“Name”: {
“type”: “string”,
“title”: “Name”,
“id”: “txtName”,
“required”: true
},
“Password”: {
“type”: “string”,
“title”: “Password”,
“format”: “password”,
“required”: true
},
“Email Address”: {
“type”: “string”,
“title”: “Email Address”,
“format”: “email”,
“required”: true
},
“Cell Number”: {
“type”: “number”,
“title”: “Cell Number”,
“maxLength”: 10,
“minLength”: 10,
“required”: true
},
}
},
“options”: {
“form”: {
“attributes”: {
“action”: “http://httpbin.org/post&#8221;,
“method”: “post”
},
“buttons”: {
“submit”: {
“click”: function () {
this.ajaxSubmit().done(function () {
$.ajax({
url: “”,
type: “”,
dataType: “json”
});
});
alert(” User Name : ” + $(‘[name=”Name”]’)[0].value + “\n Email Address : ” + $(‘[name=”Email Address”]’)[0].value + “\n Cell Number : ” + $(‘[name=”Cell Number”]’)[0].value);

}
}
}
},
}
});
});

<link type=”text/css” href=”http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css&#8221; rel=”stylesheet” />
http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js

http://code.cloudcms.com/alpaca/1.5.17/bootstrap/alpaca.min.js

</body>
</html>

Step II

Click here for: Step by step creating Content Editor webpart and associate with HTML

Step III

Final result will be as below,

Alpaca Demo

O365 -SharePoint Online: step by step creating Content Editor webpart and associate with HTML

Introduction

For creating content editor webpart by using HTML is common requirement for SharePoint. Here we are covering the steps of achieving the same for O365 SharePoint online.
Alpaca Demo

Download user guide

Click here to download steps by step guide

Step by step approach

Step I

Go the site where to create Content Editor webpart.

Step II

Create Asset Library or Document Library for repository of HTML, CSS, JS etc. resources related to specific Content Type webpart.

Step III

Create folder for Uploading your files of step II with same name of webpart.
2

Step IV

3

Step V

Upload the source files,
4

Step VI

Edit the page where you want to add webpart using below steps,
5

Step VII

Edit the properties of Content Editor webpart which have been added using step V,
6

Step VIII

Copy the html path from step V to the properties as below,
7

Step IX

Now your webpart is ready with HTML loaded,
Alpaca Demo

SharePoint 2013 Troubleshooting: Document Library documents with duplicate document ID

Issue

In a document library there are same document id for two documents. There should be unique Document Id for a document. But duplicate Id’s are generating for different documents as below example,

e.g. There is Sales File, Accounts File with same document id: Doc-10-100
If you click on ‘Sales File’ –> Sales File.docx file is opening.
If you click on ‘Sales File’  Doc id: ‘Doc-10-100’ –>opening ‘Account File.docx’. Actually it should open ‘Sales File’.

Solution

Getting duplicate document id was a product issue after moving document (using manage content and structure) to different library. After move operation, document gets attached with  Persist ID attribute which is root cause of the issue.

This has been resolved in August 2015 CU – Click here to download .

But for existing duplicate document D’s required to be take care by some cleanup process.