Enable/Disable Modern UX in SharePoint Online with PowerShell & CSOM

Microsoft has announced the rollout of several new enhancements to SharePoint Online team sites in Office 365. These  enhancements are the Modern UX for Team Site publishing pages/new web parts and OneDrive for Business sites in SharePoint Online in Office 365. Modern lists and support for Microsoft Flow and PowerApps, Modern Document libraries, Site Contents Page of Team sites already have the modern UX. A default out-of-the-box setting is available in Office 365, SharePoint admin center to switch the Design mode to the New Modern UX or to stay Classic.

Note: We need to note that `classic’ experience is not deprecated and both `classic` and `modern` will coexist.

In addition to these, we need to control the settings to implement the new design for multiple sites in an Office 365 environment. There are PowerShell commands available that you can use to add or remove hidden features related to the new Modern UI, at Web or Site Collection level using the popular CSOM.

We need to understand the reasons to switch from Modern UX to Classic at various scope levels.

  1. When you have customizations that affect document library pages.
  2. Whenever the pages represent business-critical functionalities.

We can determine which sites and site collections have to be changed to Classic using the following PowerShell script with a CSOM.

Please follow the given steps using SharePoint Online Management Shell to enable or disable Modern UX for SharePoint Online Team sites using the CSOM model.

Step 1 – Add the assemblies to Run the following in SharePoint Online Management Shell

Add-Type -Path “C:Program FilesSharePoint Online Management ShellMicrosoft.Online.SharePoint.PowerShellMicrosoft.SharePoint.Client.dll”

Add-Type -Path “C:Program FilesSharePoint Online Management ShellMicrosoft.Online.SharePoint.PowerShellMicrosoft.SharePoint.Client.Runtime.dll”

With the latest SharePoint Online Management Shell installed the above assemblies should be in your “C:Program FilesSharePoint Online Management Shell” folder as shown below.

Steps 2 – We need to load the variables for your Site Collection and Web as required. Provide a global administrator credentials in the below code snippet.

Step 3 – Change the Classic experience for sites/site collections.

To change the Classic experience for document libraries on a site collection/Site Contents Page, we need to REMOVE the feature ‘E3540C7D-6BEA-403C-A224-1A12EAFEE4C4’ from Site Collection feature definition.

To switch your Site Collection to New UX, run the following code snippet:

To switch your Site Collection to Classic mode, run the following code snippet:

Step 4 – Change the Classic experience for Web/Subsites in a site collections.
To change the Classic experience for document libraries on a Web/Subsite, we need to REMOVE the feature ’52E14B6F-B1BB-4969-B89B-C4FAA56745EF’ from Website’s feature definition.

To switch your Web to New UX mode, run the following code snippet:

To switch your Web to Classic mode, run the following code snippet:

We can login to the site/site collection and test the Site Contents page on your SharePoint Online site in Office 365.

With the Modern UX in SharePoint Online in Office 365

Below picture represents the Classic UX in SharePoint Online in Office 365

Uses of Office 365 Planner

Challenges in the modern work place:

Recently, we have come across multiple challenges in the modern work place, such as:

  1. Users work from multiple locations
  2. Most of the user’s time goes in looking for information
  3. Failure to coordinate across units and users
  4. Microsoft project server is too complex or too robust for their needs. So users simply turn to Microsoft excel for managing projects and tasks.

The Microsoft Office 365 lineup introduced a new and improved way for business using Planner tile in office 365 Launcher. Office 365 Planner has  been rolled out to all eligible Office 365 customers, including Office 365 Enterprise E1-E5, Business Essentials, Premium and Education subscription plans.Customers with these subscriptions, will see the Planner tile in the Office 365 launcher when it becomes available.

Office 365 Planner is a new project management, enterprise-ready and globally available team collaboration app that lets you assemble team work organize visually and easy to use, assign and update tasks, share files, chat and more.

Office 365 planner’s key aspect is the `Hub’, where we can visually see plans and tasks along with overall progress and can go through each task. We can see who is on time and who is falling behind in the hub. The pllanner utilizes the concept called `Boards’ , to keep team work organized in each board. Boards are individual cards, which will have their own due date, conversations, attachments and categories. Cards can have attachments (images,documents etc) to assess information in just a single glance. Cards can be represented as columns called “Buckets” and buckets can be prioritized and color coded in the planner. Visual dashboards and email notifications help to keep everyone informed on progress.

With Planner,  users and teams can create plans and each new plan automatically creates a Office 365 group. Users can create a “Task” and its details as shown below.

Conversations in the Planner will be accessible in Outlook 2016, web Outlook and in the Outlook app as well. The Planner is tightly integrated with conversations, calendar and OneNote etc. We have the option to select and remove favorite plans in the planner hub.

Planners support  technical requirements larger organizations demand, including multiple redundant backups, instantaneous recovery and HIPAA, FISMA, ISO27001 and EU Model compliance.

We have options to add members to the plan and that member will be automatically added to Office 365 Group related to that plan.We have charts in Office 365 planner . These charts will display the summary of the tasks visually as shown below

Planner app hosted on the azure environment and developed using Microsoft graph API as shown below:

Office 365 Planner enters a competitive world which includes other softwares like Trello, Atlassian’s JIRA Core and Asana. Planner will fill Microsoft customers’ need for a more lightweight, easy-to-use tool and replacement for SharePoint Tasks, which were removed well ahead of Planner’s initial debut.

Advantages of the Planner when compared  to other applications are

  1. Lightweight and easy-to-use tool.
  2. Integrated with Office 365 as an online app.
  3. Enterprise-ready and globally available app.
  4. Visualization might give planner thumbs up over competitor.
  5. Cute color-coding to denote task progress.

Some of the new features Microsoft plans to introduce over the next few months are:

  1. Ability to assign a task to multiple users.
  2. External user access and assigning task.
  3. Customizable boards.
  4. Plan templates.
  5. Apps for iOS, Android and Windows.

When To Use Content Query Web Part (CQWP) and Content Search Web Part (CSWP)

Share Point 2013 has several out-of-the-box web parts and the most widely of these are Content Query Web Part (CQWP) and the Content Search Web Part (CSWP). These two web parts are used for querying and search crawl indexed data from a share point site.

ContentByQuryWebpat referred as Content Query Web Part (CQWP) is used to display content using query/filter from another site or sub site within the same site collection. With the CQWP, content display as per the requirement, branding and context can be controlled. CQWP results are pulled using query or search directly from the site.

Content Search Web Part (CSWP) is available with SharePoint On-Premise and in Office 365 tenants. CSWP uses search indexing to return faster results using less resources. CQWP and CSWP web parts require publishing feature to be activated.

Let us explore the best situations/scenarios for using each web part.

Content Search Web Part (CSWP)

  • When we need to display all items of a type with n a site collection or from a different site collection.
  • When we need to deal with a complicated query for instance a certain content type in a certain date range.
  • When we need to customize the display of the items.

Content Query Web Part (CQWP)

We can use Content Query Web Part (CQWP) when we want to display a finite list of properties like title, description and image.

Please see the below image for more details on the same.

Pros and Cons

Web Part Behavior Content Query Web Part (CQWP) Content Search Web Part (CSWP)
Query configuration Easy You will need to know about certain search features such as managed properties.
Query across large amounts of content Limited yes
Handle complex queries Limited yes
Scale to handle future content growth Limited yes
Display content from other site collections No yes
Design of query results can be customized Yes, by using XSLT. Yes, by using HTML.
Maintenance cost in a complex site architecture High Small
Narrow down the query results that are displayed in the Web Part No Yes, in combination with other search web parts.

Customizing ‘Content Query Webpart ItemStyle’ using XSLT in SharePoint 2013

Share Point 2013 has many out-of-the-box web parts and one  of them, i.e. a widely used  web part is Content Query Web Part (CQWP). ContentByQuryWebpat referred to as Content Query Web Part (CQWP) is used to display content using query/filter from another site or sub-site within the same site collection. With the CQWP, content display as per the requirement, branding and context can be controlled. CQWP style sheets reside in a folder “XSL Style Sheets” in the Style Library. ItemStyle.xsl file named under “XSL Style Sheets” folder contains the style templates which can applied on-the-fly to the items returned by CQWP.

Create custom style by making a copy of ItemStyle.xsl file and make changes as required to it. Upload the customized xsl file to the style library and publish it.

Note :  The Content Query Web Part is only supported in publishing sites. So, you must have the publishing features enabled to make use of it.


  • Aggregate data only within a single site collection.
  • Aggregate only list information.

Imagine that we have a requirement to display list data across sub-sites in a site collection. For instance we need to make use of a list to retrieve respective employee biographies across sub-sites in a site collection. Let me explain the scenario:

For instance the below hierarchy of share point site collections:

The requirement is to display upcoming events from a calendar in all sub-sites under communities’ site collection. We have a column named community which is used to filter and type will be choice in the same calendar list which is created as “Upcoming events” at communities site collection level. Please see the below picture for reference:

I  used out-of-the-box content query web part to retrieve events from the calendar list and community column to filter the context events. I also thought of customizing itemstyle.xsl which resides in the Style Library of the site collection. To achieve this, the following steps need to be taken:

Customizing the ItemStyle XSLT file in Share Point 2013

  1. Open the site collection URL and Open the XSL Style Sheets folder to view the Itemstyle.xsl file.

  • Download the ItemStyle.xsl file to your computer. Edit that file using notepad or share point designer 2013
  • Copy the below code block and paste it above the closing </xsl:stylesheet> Here the first HTML Table row and the second HTML table row represents the column headings and the actual data respectively.

Make sure that you use this code block to output a header in XSLT:

  1. Save the file, upload the updated file to XSL Style Sheets folder in Style Library folder. Publish a Major Version to see the changes in the itemstyle.

Customizing the content query web part properties configuration in Share Point 2013

  • Open Share Point 2013 page, where you wanted to add web part and click Site Actions, and then click Edit Page. The page will displayed in edit mode as depicted in below screen.

In Editing Tools chose insert Web Part and click “Content Rollup” Category then select “Content Query” showing in parts and click Add button. Refer the below screen

  • Web part will be shown as below and customize the web part properties using “Edit Web Part” context option as directed in the below reference

  • Customize the web part properties under query section, select Show items from the following list radio button and click browse button. Select List or Library pop up will be displayed and select the “UpcomingEvents” list. Refer the below screen shot.

Now change the following additional settings in the web part, which are as per your requirement. Traverse to Styles section to view the properties which will look similar to the below screen shot. Make sure that you will take care of Fields to display as provided in the reference. Then click “OK” button to save the changes to the CQWP. Refer the below screen shot.

Customized content query web part in Share Point 2013



Exit mobile version