Add the Classification Columns to New Sites

Prev Next

This document describes how new SharePoint sites get the eSHARE classification columns through the tenant's default site templates, and how to check that the templates are in place. The templates are set up by Deploy the eSHARE Classification Columns, so there are no separate commands to run. The following steps will be reviewed:

PREREQUISITES:

The person performing these steps should be a SharePoint Administrator using the computer and certificate set up in Create eSHARE Classify SPO Columns Entra ID App Registration.

How the Default Site Templates Work

A site template set as the default for a site type runs its site script a few minutes after any new site of that type is created. The eSHARE site script, eSHARE classification columns, creates the five classification site columns and adds them to the new site's Documents library.

Every run of Set-SPOClassificationColumns.ps1, in Report or Apply mode, checks this before it touches any site. It builds the site script from the column definitions and registers it, or updates it if the definitions have changed. It then checks the default template for each of the three site types: team sites with a Microsoft 365 group, team sites without a group, and communication sites.

What the run finds

What Apply does

No default template for the site type

Registers eSHARE Team site, eSHARE Team (no group) or eSHARE Communication site as the default

Your organization's own default template

Adds the eSHARE site script to it. Your template stays the default.

An eSHARE template that isn't the default

Makes it the default

A default that already runs the eSHARE site script

Nothing; reported as OK

Note:

An eSHARE default template replaces Microsoft's default for that site type; new sites otherwise look the same. Site scripts only add: if a site owner later applies another template from the gallery, the columns stay.

Check the Default Site Templates

  1. Open the 'Summary' sheet of the latest deployment report. The three 'New sites' rows show OK once the templates are in place; Planned means the next Apply will set them up.

  2. Create a test team site from the SharePoint start page and wait a few minutes.

  3. Open the new site's 'Documents' library and confirm that the 'Data Sensitivity', 'Data Classification' and 'Data Attributes' columns are shown.

  4. To list the templates directly, connect to the SharePoint admin center with the app, using the version for your cloud, and run:

Import-Module PnP.PowerShell
Connect-PnPOnline -Url "https://contoso-admin.sharepoint.com" -ClientId "<Application (client) ID>" `
    -Tenant "<Directory (tenant) ID>" -Thumbprint "<certificate thumbprint>"
Get-PnPSiteDesign | Select-Object Title, WebTemplate, IsDefault
Import-Module PnP.PowerShell
Connect-PnPOnline -Url "https://contoso-admin.sharepoint.us" -AzureEnvironment USGovernmentHigh `
    -ClientId "<Application (client) ID>" -Tenant "<Directory (tenant) ID>" -Thumbprint "<certificate thumbprint>"
Get-PnPSiteDesign | Select-Object Title, WebTemplate, IsDefault

What the Templates Miss

The default site templates only run once, when a site is created. They don't cover:

  • Libraries added later to a site created from a template. A site script can't link the columns to the site's Document content type, so a library added to that site afterward doesn't get them.

  • New OneDrives. Site templates don't run for OneDrive.

  • Existing sites. Sites created before the templates were registered don't run them.

  1. To add the columns in these cases, run the Apply command from Add the Columns to OneDrive again. It covers SharePoint sites and OneDrive, adds the columns wherever they are missing, and leaves everything else alone.

  2. Repeat it regularly, e.g. monthly, and after onboarding new users. For help scheduling it, contact eSHARE Customer Success.