SharePoint Online: Site Design and Site Scripts

Administrators of SharePoint Online can create and upload custom site templates with the use of the Site Designs and Site Scripts features. These two features are supported for SharePoint Online subscribers and for the Modern Team and Modern Communication Sites. With Site Designs and Site Scripts, users will be able to use these customized templates during their site creation process.

Why use site designs and site scripts? Standardizing and maintaining branding consistencies are two examples of why site designs and site scripts should be used. These features automate the provisioning of new or existing modern SharePoint Online sites with custom configurations when new sites are created by users within the organization.

How do Site Designs Work?

A Site Design is very similar to a template as it can be applied each time a new site is created so that a consistent set of actions occur. Site Designs can be applied to existing Modern Sites, especially to connected groups in Team and Communication Sites. Site Design can include various actions such as setting the site theme, creating lists, sending a tweet, or recording the new site URL to a log (these are just a few examples).

Site Designs can be created and then registered in SharePoint Online to either the modern template Team Site or the modern template Communication Site. This can be done by:

  1. Go to the SharePoint homepage on your developer tenant;
  2. Choose Create Site;
  3. Two options will appear: Team Site and Communication Site;
  4. Choose Communication Site; and
  5. Choose one of the three default Site Designs that appear in the Choose a Design box. The three options are Topic, Showcase, or Blank. For each site design, there is a title, description, and image.

SharePoint creates the new site based on the site design that is selected. As it creates the new site, site scripts are ran in the background that provide the details for the site design. Details might include theme colors that match corporate branding, a color scheme that works with branding, or the creation of new lists. The site creator can click on the notification bar to view the status of the actions being applied.

Once the site scripts are completed, the notification bar message will change, offering options for the site creator to either refresh the page to see the results of the applied scripts, or to view the site script details.

In December 2018, with roll out to be completed worldwide by early 2019, the site design information panel can be invoked by a site owner to see what site designs have been applied to the site. This can be invoked at any time. Script details will also be available plus new or updated site designs can easily be applied through the panel.

SharePoint will display the detailed results of the actions in the scripts in a progress pane once the actions are completed. An excellent point to note is that site design can be applied to previously created modern site collections!

What is a Site Script?

What composes a site script? Site scripts are JSON files that specify an ordered list of actions to run when creating a new site. The orders are ran in the order that they are listed. We could delve into the anatomy of a JSON script file, but we will leave that for now. Instead, understanding what a JSON script file consists and its schema will suffice.

Each action in a site script is specified by a verb value in JSON. Actions that are available include: creating a new list or library, modifying the default list or library that is created with the site, creating site columns, content types and configuring other list settings, applying a theme, setting a site logo, adding navigation, triggering a Microsoft Flow, installing a deployed solution from the app catalogue, setting regional settings for the site, adding principals such as users and groups to SharePoint roles, and setting external sharing capabilities for the site.

After provisioning, Site Scripts can be re-run. Re-running the Site Script will not cause any damage to the script. It will simply ensure the site matches the configuration in the script. There is a new limit of 100 site scripts and 100 site designs per tenant. Site designs and site scripts can also be created by using PowerShell or the REST API.

Triggering a Microsoft Flow

Microsoft Flow can be triggered by a site script, which provides the flexibility of specifying any custom action that is required beyond the native site scripts.

Microsoft Flow can be integrated with site designs if the PnP provisioning engine is used to automate site creation. All existing provisioning scripts can be maintained, and new custom provisioning scripts can be created by using this technique. How does this work? The process works like this:

  1. The script instantiates your Microsoft Flow using an URL with additional details;
  2. The Flow sends a message to an Azure storage queue that you have configured;
  3. The message triggers a call to an Azure function that you have configured; and
  4. The Azure function runs the custom script to apply the custom configurations. An example of the custom script is the PnP provisioning engine.

Targeting or Scoping

To ensure that only people that are intended to see the site see it while excluding others, site designs can be configured for specific groups or individual people in the organization. When a site design is created, the default is to allow everyone to view it. Your target group or individuals, your scope, can be applied by using the Grant‑SPOSiteDesignRights cmdlet or the GrantSiteDesignRights REST API. The scope can be specified by user or a mail-enabled security group.

With Site Design and Site Scripts, site owners can ensure consistent and standard values to Modern Team and Communication Sites that users in the organization are creating. These automated actions run in the background and provide assurance that users will create new sites that will reflect the organization’s branding and will also ease the process of creating new sites. New sites can be scoped for specific groups, or individuals, to ensure that only the users who need access to view and use will have it while excluding others.

  • Sunday, December 23, 2018 By : Mike Maadarani    0 comment