Walkthrough of Site Provisioning process using PnP PowerShell

In the previous blogs here, we have looked at the Provisioning process for a complex Team site. Much of complexity was easily handled by the PnP Provisioning process.

In this blog, we will look at the similar Provisioning process but from an Admin point of view and use PnPPowerShell for create and provision the site.

The steps are actually quite simple and could be done quickly.

1. Build a Template Site to be used for creating the Provisioning Template

2. Manually apply changes to the Template site and extract the Provisioning template from the Template Site using the Get-PnPProvisioningTemplate

3. Create the SharePoint Team site to apply the template

4. Apply the Provisioning template to the above site using the Template obtained in Step 2

5. Finalize the creation with any remaining changes.

Before we start looking at the above steps in detail, below are few key items to keep in mind during the provisioning process. Some of the these will become clear as we go through the detailed process steps

1. During the Get Template process, one of the key switches is to include/exclude any dependancy items which are not related to the new site. More details with Get-PnPProvisioningTemplate section

2. During the apply template process, only the differential changes are applied. Hence it is safe to apply the template many times or repeatedly in case of an error occurs during the process

3. Since the apply template process only adds differential items, any explicit changes for eg. left navigation default links removal needs to be done after the apply template process is complete.

4. The apply template works by matching the Provisioning Template schema with latest PnP code schema. Hence, if you are working with a old template then use the Schema switch as specified below.

Get Template Process

The first step would be to install the PnP PowerShell module. Check this blog here to see how to get started with PnP PowerShell.

Next create a template site that will be used to create the new sites.

After the site is created, we could create a template from it using the Get-PnPProvisioningTemplate cmdlet. Some of the key switches while creating the template are below.

Helpful Switches for Get-PnPProvisioningTemplate cmdlet

-ExcludeHandlers – Custom handlers to exclude settings or elements from the site sucha as ApplicationLifecycleManagement, Site Security, WebApiPermissions etc.
-ExcludeContentTypesFromSyndication – Exclude the Content Types pushed from the Hub. This is generally helpful if content types no longer persist and could cause conflict issues.
-ExtensibilityHandlers – Allows to specify ExtensbilityHandlers to execute while extracting a template for doing custom actions such as exporting pages schema into PnP export
-Handlers – Custom handlers to explicitly include settings or elements from the site such as Audit settings, Features, Fields, Search Settings, Term Groups etc.
-Schema – PnP Schema version of the exported template
-IncludeSearchConfiguration – Include the Search Configuration of the site
-PersistMultiLanguageResources – Persist Multilingual files

Apply Provisioning Template Process

After the template is extracted, we could apply this template to any newly created site. Before application of the template, we will create a new modern site using the PnP PowerShell command below

Next is to apply the template which takes about 20-25 minutes for a complex template with about 20 libraries, 30 site columns, 15 content types etc. Since the process takes so much time, it would be good to trace log any issues and error handle the application process.

The Apply Provisioning Template cmdlet details are below. It is important to note some of the switches for the cmdlet as it does apply some custom settings for the template.

Helpful Switches for Apply-PnPProvisioningTemplate cmdlet

-ClearNavigation – Clear the Navigation of the site before template is applied
-IgnoreDuplicateDataRowErrors – Ignores to stop the script because of duplicate daa errors
-ExcludeHandlers – Exclude the handlers when applying template
-ExtensibilityHandlers – Apply the extensibility handlers for the custom scripts


In this blog we saw how we could use PnP PowerShell and PnP Provisioning Template to apply custom template to a newly created site in order to automate the creation process.

Deploy SPFx web parts to a Site Collection only – Site Collection App catalog

One of the few hidden gems of SharePoint Online hosting model is Site Collection App Catalog. Yes, you read it right, Site Collection App catalog !!!, not Tenant App catalog. Don’t confuse this with delegating app catalog rights to Site Collection Administrators. This is different and the requirement is to have the app deployed and scoped to a Site Collection only.  For more details about deployment options, please check here

So what does it mean by Site Collection App catalog ? Site Collection App catalog, as the name rightly implies, is an App catalog scoped for a site collection. In other words, it elevates a Site Collection to allow hosting Apps and create a App Catalog in the Site Collection.


The Site Collection App Catalog could be enabled using the following script.


  1. Deploy apps to the Site Collection scope only. Even if tenant app setting is On in web part, the Tenant Apps are deployed to site collection scope only
  2. Apps can only be added in the installed site collection and thus decreasing risk of accidental installation at other locations
  3. Allow Site Collection Administrators to manage deployments
  4. There is support for SharePoint Add Ins
  5. When included in the package, the assets are deployed and maintain in the site collection only
  6. Distributed release cycle management could allow better functionality for upgrades


  1. Lack of tracking Site Collections where the Site Collection App catalog feature is On
  2. Removal of Site Collection App catalog still leaves the App catalog library but apps cannot be installed
  3. No technical restrictions to prevent the web parts from accessing other site collections


In the above blog we saw how to use Site Collection App Catalog for deploying web parts in the restricted scope of Site Collection.


Pump up your investments in Modern Intranet and Team Sites with latest cool advancements (Ignite 2018)

At Ignite 2018, Microsoft provided a great perspective about how Modern Intranets (using SharePoint Communication Sites) and Collaboration features are becoming a major collaboration platform for many companies and investments Microsoft is doing to make them better. Some of these cool features were mentioned during the event. We will take a look at many of them in this blog and how we could use it to make Modern Intranets, Modern Team Sites and Microsoft Teams work even better and seamlessly together.

If you are looking a strategy or starter guide for building Modern Intranet using Communication sites, check here.

Another reason for writing this blog is that earlier I had posted some of these postings from Microsoft updates in my LinkedIn and Twitter feed but found that information was too scattered and hard to collate, so thought of combining all here. Please feel free to use it as useful.

Note: There will be another blog about Tenant level enhancements in SharePoint Modern Admin Center and Security and Compliance
PS: The blog is about 3-5 min read but it is full of goodness, so worth a read

The brief highlights of the latest updates are as follows:

1. New Page designs – It is possible to select different page designs when adding a page, which adds a lot of variety, and additionally provides prebuild content besides the standard page sections.


2. Audience targeting – Audience targeting provides personalised content to users and can be set on a unified group, active directory group or user.


3. Conversations (New Yammer) web part – This is going to be updated version of the current Yammer web part.


4. Make Communication Sites as a root site – What else could be more cool than now having your Modern Intranet Communication site to be set as the root for your Tenant

5. Mega menus for top navigation – Top Navigation will not be limited to only one level (which is hardly the case right !!!)


6. Search Associated Sites from Hub site – We can search associated sites under a SharePoint hub site from the hub search


7. Web part Connections (Dynamic data) – Not exactly clear yet how this will work yet but assuming it will be the same the old web part connections (but better) to be able to pass a property from existing to another web part.


8. File cards – Get a brief snippet of the document with terms and information that is editable


9. Column formatting from edit properties – Now we can add column formatting on the edit pane of the list instead of writing JSON (at least for the simple ones) for it.


10. Custom web parts on list edit web part views– We can have custom web parts on list views,  so no need to create custom pages to have custom views for lists.


11. SharePoint UI layout coming to Teams – So now there will be no difference when a library is viewed in Teams or on the web. The biggest advantage is that no switching between Teams or SharePoint to fill metadata or use other features such as Sync directly from MS Teams (great !!!)


12. Modern Teams linked libraries now visible on SharePoint – This allows users to know the content is also accessible through Teams.


13. SharePoint news feed into Microsoft Teams – Now we could publish SharePoint news to a Teams Channel allowing users to view the news content in teams itself.


14. Edit Metadata when uploading file to SharePoint One Drive folder in Mobile


15. Stream Mobile App and Live Streaming video from SharePoint – With the Stream mobile app to stream videos and keep for offline viewing. Also there is an additional feature to live stream videos from the portal.

This slideshow requires JavaScript.

16. Modern Document Templates and Document sets – Getting back Document templates to the new button and Document sets are back to modern libraries

17. File Plans, New Labels and Label analytics – File plans allow to manage department, categories, identifiers etc at scale. New labels coming up such as Immutable Record labels and sensitivity labels applied to a site. Finally we will have label analytics to look at usage reports.

This slideshow requires JavaScript.

18. Clips webpages from Mobile phone onto your website (iOS and Android integration) – so now you could share a clip of a web page from Android or iOS to the SharePoint app and site directly


19. PowerApps integration in Document libraries – Use PowerApps to create custom. Forms for SharePoint Document libraries

Above, we saw some of the important and highlighting updates from Ignite 2018. There will be another blog about updates about latest SharePoint Admin Center and Security and Compliance updates, not covered here.

Bring in Strategy for building Next-gen Modern Intranet using Communication Sites

With the modern responsive design and full-page layouts, Communication sites are an ideal candidate for Intranet sites. During last few projects, we have implemented Modern Intranet portals using Communication Sites and found that user adoption was exceptionally high. We also gained a lot of experience from these implementations, which I will be sharing here.

Note: Most of the below features and advancements are of during Oct 2018, there are few major releases from Ignite 2018 which be released later. I will be providing more information on them in upcoming blogs.

Before we start discussing about the planning and implementation steps, lets’ look at some of the advantages of Communication sites.

  1. Modern page authoring and easy metadata management
  2. Responsive full-page layout and design
  3. Modern configurable and responsive web parts
  4. Easy content sharing and collaboration feature
  5. Modern libraries, content filtering and filtering features


It is important to plan the Modern Intranet as per requirements for the business. Some of the key elements could be:

  1. Owner and Collaborators – These are key stakeholders and will need to onboard prior to the release
  2. UX/UI Design components – This is really important for a good usability and user flow. An important point to note is that the not everything in SharePoint Modern Site customisable, so it will be important to involve a SharePoint Technical person too for this.
  3. Customizations required – These are solutions that fall out of scope of SharePoint online existing or OOB functionalities. For eg. custom webparts, header or footer components, custom pages, and workflows. Again a SharePoint technical team member will be helpful to identify these.
  4. Training and Support – These are critical for a good adoption of the platform with it goes live.
  5. Feedback sessions – It would be important to plan these sessions with the key stakeholders before final handover.


The steps for implementation would be at high level as below:

1. Home page layout and component

The Home page is one of the most visited pages in the Intranet and hence needs to be planned thoroughly. Try mix and match options with various web parts such as Hero web parts, Yammer, Highlighted content, News content etc.

2. Site and Content Pages implementation

The next important bit is to create content pages and site pages that distribute content across the Intranet. It is important to use a consistent concept across these pages so that teams can find it easy to use. Most of the successful components in this area are:

  • Highlighted content web part
  • Document library web part
  • Text
  • Quick Links (with image preview) etc.

For custom page creation and content approval flow process, please check the blog here. Also in an upcoming blog, we will look at how to use OOB Page approval flows for implementing page approvals with site pages.

3. Ease Metadata management

Metadata management is taking a next leap with modern pages and libraries. We can now set a page metadata on a page itself by editing which is quite cool as the authors don’t have to go searching for the Pages library to edit metadata.


Also there is a page details web part of you would like to show the metadata on the page.

4. Apps

Apps play an important role in an Intranet too. All the corporate, admin and IT forms can now be integrated into the modern pages seamlessly using PowerApps or custom build SharePoint Framework solutions.

Also an important component for a new Intranet would be to get feedback on it. Use a Microsoft Forms survey for to capture the feedback.


The above is a quick overview of Communication sites as Modern Intranet. Please keep an eye for more upcoming blogs on more technical details.

Options to consider for SharePoint Framework solutions deployment

There are various options to package and deploy a SharePoint Framework solution and as part of packaging and deployment process, the developers have to identify a best approach for their team. Sometimes it becomes a nightmare to plan the right approach for your solution, if you haven’t weighed the options properly.

Working at multiple implementations of SPFx solution for sometime now, I have been able to get an idea of various options and approach for them. Hence in this blog, we will at these options and look at merits and limitations for each.

At a high level, below are the main components that are deployed as part of SPFx package deployment:

  1. The minified js file for all code
  2. The webpart manifest file
  3. Webpart compiled file
  4. The package (.pckg) file with all package information

Deployment Options

Please check this blog for an overview of the steps for building and packaging a SPFx solution. The packaged solution (.sppkg) file can then be deployed to a App catalog site. The assets of the package (point 1-3 of above) could be deployed by any of the four below options. We will look at the merits and limitations for each.

1. Deploy to Azure CDN or Office 365 CDN

The assets could be deployed to an Azure CDN. The deployment script is already a part of SPFx solution and could be done from within the solution. More detailed steps for setting this up are here.

Note: Please remember to enable CORS on the storage account before deployment of the package.

If CORS is not enabled before CDN profile is used, you might have delete and recreate the Storage account.


  • Easy deployment using gulp
  • Faster access to assets and web part resources because of CDN hosting
  • Add geographical restrictions (if needed)


  • Dependency on Azure Subscription
  • Proper set up steps required for setting up Azure CDN. In some cases if the CDN if not set properly, then the deployment has to be done again.
  • Since the assets are deployed to a CDN endpoint, so if assets need restricted access then this mayn’t be recommended

2. Deploy to Office 365 Public CDN

For this option, you will need to enable and set up Office 365 CDN in your tenancy before deployment. For more details of setting this up, check the link here.


  • Faster access to assets and web part resources because of CDN hosting
  • No Azure subscription requirement
  • Content is accessible from SharePoint Interface


  • Manual copy of assets files to CDN enabled SharePoint library
  • Office 365 CDN is a tenant setting and has to be enabled for the whole tenancy
  • Since the assets are deployed to a CDN endpoint, so if assets needs restricted access then this mayn’t be recommended
  • Accidental deletion could cause issues

3. Deploy to SharePoint document library

This is also an option to copy for the compiled assets to be copied to a SharePoint document library anywhere in the tenancy. Setting this up is quite simple, first set the setting “includeClientSideAssets”: false in package-solution.json file and then set the CDN details in write-manifests.json  file.


  • No need of additional Azure hosting or enabling Office 365 CDN
  • Access to Assets files from SharePoint interface


  • Manual Copy of assets file to SharePoint library
  • Accidental deletion could cause issues

4. Deploy to ClientAssets in App Catalog

From SPFx version 1.4, it is possible to include assets as part of the package file and deploy it to the hidden ClientAssets library residing in App Catalog. It is set in the package-solution.json file “includeClientSideAssets”: true.


  • No extra steps needed to package and deploy assets


  • Increases the payload of the package file
  • Risk for Tenant admins to deploy script files to the Tenant App Catalog.


In this blog, we saw the various options for SPFx deployment, and merits and limitations of each approach.

Happy Coding !!!


Provisioning complex Modern Sites with Azure Functions and Flow – Part 3 – Post Provisioning Site Configuration

In the previous two blogs part 1 and part 2, we looked at steps to create a Modern team site and apply a custom provisioning template to it. In this blog, we will have a look at the steps for the post provisioning process to implement site specific requirements. Some of them could be:

1. Apply default values to list fields
2. Create a bunch of default folders
3. Manage Security groups (SP level) and permission level.
4. Navigation level changes
5. Add/Enable web parts or custom actions (SPFx extensions)

Most of the above steps are part of SharePoint Provisioning processes for a long time, just are less complex now with Provisioning templates doing a lot of heavy lifting. I will be writing very soon about PnP Templates, do and don’ts.


One key point to add is that, with Modern Team Sites and Office 365 Groups we cannot add AD security groups into a Office 365 Unified Group. For more information, please see this link.

The apply template process (link) takes about 45-90 min (long running process) for complex templates so wouldn’t be possible to start the post process on a flow wait state. Hence, we could trigger the post provisioning process on update of an inventory item or poll an endpoint for the status. In our case, we triggered the process when updating the inventory list with a status that apply template process is complete.

Post Provisioning Process

1. The first step of the Post Provisioning proces is to make sure that noscript is enabled on the team site (link) and all dependencies are ready such as Term stores, Navigation items, Site Pages, Content types, site columns etc. For a complex site template, this step will check for failure conditions to make sure that all artefacts are in place.

Note: The below sequence of steps could vary based on the solution 
and site structure in place but this was the faster way to 
isolate issues and ensure dependencies.

After the failure checks are done, we will start with the Site structure changes and navigation changes. For implementing navigation changes, check the blogs here and here.

2. Next, we will update any site specific site columns, site content types and permission level changes. A upcoming blog will have more details to this.

3. After that, we will update the changes for list structure, we will move to list specific updates such as default value setting, modifying list properties etc.

4. Next let’s move on to Apps and Site Pages updates. These changes take time because of SharePoint ALM lifecycle any possible duplications. So error handling is the key. Please check the blog here and for steps to deploy app and web parts here.

5. Before we finalize the site, let’s provision folders and metadata. This is not a simple process if you have to set metadata values for large number of folders like in our case 800 recursive folders (child in parent). So we will use the metadata file override. All the values in the defaults file have to be hardcoded before override.

Note: The metadata file override is not generally a good approach 
because of possible corruption that renders the library unusable 
so do error handling for all cases. For the CSOM approach check here.

6. Finally, we will set the site Property bag values for Site to set some of the tags making the site searchable. Here is the blog for the same.


The above we saw the final process of Site Provisioning process with setting up site properties and attributes for preparing the site before handing it off to business for use.

Deploy and Add SPFx webparts to Modern Pages using OfficeDevPnP CSOM library

In the previous blog here, we looked at how to install apps on a SharePoint site. With SharePoint and Office Dev PnP CSOM, we could also add web parts to Modern Pages, both out of the box (OOB) web parts and custom web parts. For out of box web parts, refer to Chris O’Brien article here , where he has provided steps and also the web part IDs for the OOB webparts which is really helpful.

In this blog, we will look at steps to add a custom web part and set it properties.

For the below code, we will use OfficeDevPnP CSOM library. The high level steps for implementation are below:

1. Find the page where to add the web part. For creating a modern page programmatically, refer to this link here.

2. Find if the web part is added to the page, if not then add it using web part ID. We will read the web part ID from a JSON class where we have kept the details of the custom web part

3. After the web part is added, then set the web part properties using JSON schema of the properties using NewtonSoft.Json.

Note: If the web part app is just installed, then it might take time for 
the web part to be ready for use. 
Hence put a wait state till the web part is loaded for use.

The below code has the steps for adding the web part programmatically using CSOM


The above process could be used to add web part programmatically onto a page and set it’s properties.

Happy Coding !!

Programmatically deploy and add SharePoint Framework Extensions using SharePoint CSOM and PowerShell

In the previous blog here, we looked at how to deploy and install SharePoint Apps. Now let’s look at installing SharePoint Framework extensions – Listview command sets programmatically.

SharePoint CSOM

SharePoint Framework has three type of extensions that could be created – Application customiser, Listview command sets and Field customisers. In this blog, we will look at adding list view command sets programmatically.

Listview command extensions are actually custom actions installed in a library or list. Hence to activate it we will go to the library/list, find the installed custom actions, if not installed we will install the new custom action. Below is the code for that.


We could also use PnP PowerShell to add the Library extension onto a page using the code below

Hence, above we saw how we could add extensions onto a library or list using CSOM or PowerShell

Happy Coding!!

Deploy and Install SharePoint Apps using SharePoint CSOM and PnP PowerShell

In this blog, we will look at steps to install and deploy SharePoint apps to Modern Sites using SharePoint ALM CSOM and PnP PowerShell. Using the below steps, it is possible to programmatically deploy and install custom SharePoint Framework apps using an Azure Function or a Local PowerShell script.

Installing SharePoint Apps

SharePoint Apps can be deployed on a site using ALM (Application Lifecycle Management) APIs. After the app is installed in the App catalog, we could add it to a SharePoint site.

SharePoint CSOM

The steps are simple. The below snippet has the code for deploying and installing apps.

1. Get the App Id
2. Create an App Manager Object
3. Deploy the App
4. After deploy the app, install the app.
5. Use Try – catch to handle if the installation has already done

PnP PowerShell

First, lets’ get a list of apps in the App catalog.

Note: There are two values that is supported by scope paramaters for Apps – Tenant and Site.

Get-PnPApp -Scope Tenant
Get-PnPApp -Scope Site

If the App is not installed, then we will add the app to the App catalog

Add-PnPApp -Path "<.sppkg file location>" -Scope Site

Then, publish the App

Publish-PnPApp -Identity  -Scope Tenant -SkipFeatureDeployment

-SkipFeatureDeployment is helpful to deploy Apps across the SharePoint tenancy if the app is developed for tenant wide deployments

After the above, we will install the App

Install-PnPApp -Identity  -Scope Site

After the app is installed, it is ready to be added or used at the site.

In the upcoming blog, we will see how to add SharePoint Framework extensions and web parts programmatically.

Happy Coding!!

SharePoint Integration for Health Care eLearning – Moving LMS to the Cloud

Health care systems often face challenges in the way of being unkept and unmaintained or managed by too many without consistency in content and harbouring outdated resources. A lot of these legacy training and development systems also wear the pain of constant record churning without a supportable record management system. With the accrual of these records over time forming a ‘Big Data concern’, modernising these eLearning platforms may be the right call to action for medical professionals and researchers. Gone should be the days of manually updating Web Vista on regular basis.
Cloud solutions for Health Care and Research should be well on its way, but the better utilisation of these new technologies will play a key factor in how confidence is invested by health professionals in IT providing a means for departmental education and career development moving forward.
Why SharePoint Makes Sense (versus further developing Legacy Systems)
Every day, each document, slide image and scan matters when the paying customer’s dollar is placed on your proficiency to solve pressing health care challenges. Compliance and availability of resources aren’t enough – streamlined and collaborative processes, from quality control to customer relationship management, module testing and internal review are all minimum requirements for building a modern, online eLearning centre i.e. a ‘Learning Management System’.
ELearningIndustry.com has broken down ten key components that a Learning Management System (LMS) requires in order to be effective. From previous cases, working in developing an LMS, or OLC (Online Learning Centre) Site using SharePoint, these ten components can indeed be designed within the online platform:

  1. Strong Analytics and Report Generation – for the purposes of eLearning, e.g. dashboards which contain progress reports, exam scores and other learner data, SharePoint workflows allows for progress tracking of training and user’s engagement with content and course materials while versioning ensures that learning managers, content builders (subject matter experts) and the learners themselves are on the same page (literally).
  1. Course Authoring Capability – SharePoint access and user permissions are directly linked to your Active Directory. Access to content can be managed, both from a hierarchical standpoint or role-based if we’re talking content authors. Furthermore, learners can have access to specific ‘modules’ allocated to them based on department, vocation, etc.
  1. Scalable Content Hosting – flexibility of content or workflows, or plug-ins (using ‘app parts’) to adapt functionality to welcome new learners where learning requirements may shift to align with organisational needs.
  1. Certifications – due to the availability and popularity of SharePoint online in large/global Enterprises, certifications for anywhere from smart to super users is available from Microsoft affiliated authorities or verified third-parties.
  1. Integrations (with other SaaS software, communication tools, etc.) – allow for exchange of information through API’s for content feeds and record management e.g. with virtual classrooms, HR systems, Google Analytics.
  1. Community and Collaboration – added benefit of integrated and packaged Microsoft apps, to create channels for live group study, or learner feedback, for instance (Skype for Business, Yammer, Microsoft Teams).
  1. White Labelling vs. Branding – UI friendly, fully customisable appearance. Modern layout is design flexible to allow for the institutes branding to be proliferated throughout the tenant’s SharePoint sites.
  1. Mobile Capability – SharePoint has both a mobile app and can be designed to be responsive to multiple mobile device types
  1. Customer Support and Success – as it is a common enterprise tool, support by local IT should be feasible with any critical product support inquiries routed to Microsoft
  1. Support of the Institutes Mission and Culture – in Health Care Services, where the churn of information and data pushes for an innovative, rapid response, SharePoint can be designed to meet these needs where, as an LMS, it can adapt to continuously represent the expertise and knowledge of Health Professionals.

Outside of the above, the major advantage for health services to make the transition to the cloud is the improved information security experience. There are still plenty of cases today where patients are at risk of medical and financial identity fraud due to inadequate information security and manual (very implicitly hands-on) records management processes. Single platform databasing, as well as the from-anywhere accessibility of SharePoint as a Cloud platform meets the challenge of maintaining networks, PCs, servers and databases, which can be fairly extensive due to many health care institutions existing beyond hospitals, branching off into neighbourhood clinics, home health providers and off-site services.

Follow Us!

Kloud Solutions Blog - Follow Us!