1. How to consolidate multiple SharePoint Online lists with Content Query Web Part?

Wouldn’t it be nice if there was a way to query and display data from multiple lists.

To do this, you need to insert the ‘Content Query’ Web Part. This Web Part can be inserted on any Web Part Page.

Display all of the Custom lists in the site collection

  1. Edit the Page,Insert Webpart and pick Content Query Webpart from Content rollup folder.
  2. As soon as the Content Query Web Partis added, click the plus sign (+) next to Query to expand it.
  3. In the List Typesection, in the Show items from this list type list, click Custom List.
  4. Click OK.

Visit the microsoft resource link here.


2. So What Do I Do If My Content Query Web Part Is Missing?

There is a SharePoint site collection administration detail that sometimes causes a problem: A user will go to add it the web part to a page and find that the Content Query Web Part is missing. They are sure they are in the Standard or Enterprise edition of SharePoint (as opposed to Foundation), but the web part simply isn’t there. Why? And how do you make it available?
The answer lies in Site Collection Features. The Features are a series of options in SharePoint that can be turned on or off. Some are on by default when a site collection is created; others have to be activated before they can be used. Be aware that sometimes the name and description of a feature doesn’t tell you everything that the feature controls. In this case, the CQWP is part of a bundle of features called SharePoint Server Publishing Infrastructure. Generally we think of Publishing in SharePoint as a way to enable content management, including combining content with specific page layouts. It’s a feature commonly used by public web sites meant to provide large amounts of information (or frequently changing information) in formats similar to a newspaper or catalog. Activation of the Publishing Infrastructure is necessary, however, to make the CQWP (and certain other web parts) available for use.

A user with Full Control or Site Collection Administrator permissions can take the following steps to activate the Publishing Infrastructure:

  • Go to Site Actions > Site Settings
  • In the Site Collection Administration section, click Site collection features

On the Site Collection Features page, click the Activatebutton next to SharePoint Server Publishing Infrastructure.

Once this feature has been activated, the Content Query Web Part should then be available throughout the Site Collection.

NOTE: In addition to Site Collection Features that may be activated or deactivated, there are Features that may be turned on or off on each site; this includes the top-level site. If you want to use the full set of Publishing tools, you must also activate the SharePoint Server Publishing site feature on each site/subsite where you wish to use them.

  • Go to Site Actions > Site Settings
  • In the Site Actions section, click Manage site features
  • On the Site Featurespage, click Activate for SharePoint Server Publishing.

Keep this tip in mind whenever you can’t find a tool or feature in SharePoint – it might just be part of a Site Collection Feature or Site Feature that needs to be activated. In addition, there are some features that are enabled at the server level, so you may need to contact your server administrator if you can’t find it in the Site Collection or Site lists.


3. How can I share a SharePoint Sub-site with an AD Group using CSOM?

 Here is a function which i have modified little bit for adding Ad group in to share point group for a site collection/subsite using CSOM with powershell.

Function AddADGroup($SPGroupName,$ADGroupName)


$SiteCollection = “https://yoursitcollectionurl”

$site = Get-SPWeb $SiteCollection


$ADGroupSPFriendly = $site | Get-SPUser $ADGroupName

Set-SPUser -Identity $ADGroupSPFriendly -Web $SiteCollection -Group $SPGroupName

Write-Host $ADGroupName

Write-Host $ADGroupSPFriendly

Write-Host “Added the ADGroup” + $ADGroupName + “Sucessfully to the SPGroup” + $SPGroupName




#To Execute this function

AddADGroup “Sharepointgroup” “Domain\ADGroup”

4. How long does a workflow in O365 remain active in a paused state?

Suspended workflow instances will be terminated after 10 days. The information balloon for the ‘Internal Status’ will display the following message if the workflow is terminated:

System.Activities.Statements.WorkflowTerminatedException: The instance has been moved from the Suspended state to the Terminated state because it has expired.