Site

Site

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<Configurator xmlns="http://schemas.mavention.com/SharePoint/Apps/SiteConfigurator">
  <Providers>
    <Provider Assembly="Mavention.Make.Engine" Class="Mavention.Make.Engine.Providers.SiteProvider" NodeName="Site"></Provider>
  </Providers>
  <Site Url="{url}" Title="{title}" Template="STS#3" LCID="1033" OwnerLogin="{owner}" UserCodeQuota="0" StorageQuota="0">
    <RootWeb Url="{url}" Title="{title}" Description="{description}" Template="STS#0" LCID="1033">
      <Properties>
        <Property Name="WebTemplate">Make.TeamSite</Property>
        <Property Name="WebTemplateVersion">1.0.0.0</Property>
      </Properties>
    </RootWeb>
  </Site>
</Configurator>

The template STS#3 indicates a Team Site with no connection to an Office365 Group.
Other populair template code are:

Code Title Description
STS#0 Team Site (Classic) A site with a classic experience
STS#1 Blank Site A blank site for you to customize based on your requirements
STS#3 Blank Site A site with no connection to an Microsoft 365 Group
GROUP#0 Team Site A team site connected to an Microsoft 365 Group
SITEPAGEPUBLISHING#0 Communication Site Publish dynamic, beautiful content to people in your organization to keep them informed and engaged
WIKI#0 Wiki Site A site for a community to brainstorm and share ideas
PROJECTSITE#0 Project Site A site for managing and collaborating on a project
BLANKINTERNET#0 Publishing Site This template creates a site for publishing Web pages on a schedule, with workflow features enabled
SPSNHOME#0 News Site A site for publishing news articles and links to news articles

The following templates are using a combination of entitites to create a basic site type.

  1. Classic Teamsite
  2. Subsite
  3. Office 365 Group
  4. Microsoft Team (Requires Make 5.0 or above)
  5. Microsoft Team with private channel (Requires Make 6.2 or above)
  6. Modern teamsite (without Office 365 group)
  7. Modern communication site

Site Properties

There are numerous properties that you can define on site level. In this chapter you see examples on how to apply those site properties.

  1. Connect your site collection to a hubsite

    If you would like to associate a hubsite to your (new) SharePoint site collection, you need to add the entity “HubSiteUrl” to the “Site” tag. The value of the entity “HubSiteUrl” would be the address of the HubSite. It would look something like this in your Make template:

    1
    
    <Site Url="{​​​​​​url}​​​​​​" Title="{​​​​​​​​​​​​​title}​​​​​​​​​​​​​" OwnerLogin="{​​​​​​​​​​​​​siteowner}​​​​​​​​​​​​​" Template="STS#3" LCID="1033" StorageQuota="1024" TimeZoneId="4" HubSiteUrl="https://wmeurer.sharepoint.com/sites/hub">
    

    AnΒ example of a template can be found here. Of course you need to change the value of the hubsite to your own hubsite.

  2. Promote site as hubsite

    It is possible to promote a site collection as hubsite via PowerShell. This can also be done via provisioning. In your Make template you need to add the property “IsHubSite” to the “Site” entity. It will look like this:

    1
    
    <Site Url="{​​​​​​​​​​​​​​​​​​​​​​​url}​​​​​​​​​​​​​​​​​​​​​​​" Title="{​​​​​​​​​​​​​​​​​​​​​​​title}​​​​​​​​​​​​​​​​​​​​​​​" OwnerLogin="{​​​​​​​​​​​​​​​​​​​​​​​siteowner}​​​​​​​​​​​​​​​​​​​​​​​" Template="STS#3" LCID="1033" StorageQuota="1024" TimeZoneId="4"Β IsHubSite="True">
    

    An example of a template can be found here

  3. Configure version limit policy (site-level)

    Version limit policies control how many document versions SharePoint keeps in your libraries. Setting a policy at site level means you only need to configure it once. It is then automatically applied to new document libraries on that site.

    The following attributes are available at site level:

    Attribute Type Description
    InheritVersionPolicyFromTenant bool Clears the site-level version policy so that new document libraries inherit the tenant-level setting. Cannot be combined with any other version attribute.
    EnableAutoExpirationVersionTrim bool When true, SharePoint automatically manages version history limits using a built-in algorithm that thins out intermittent older versions while preserving high-value ones. When false, limits must be set manually via MajorVersions, and ExpireVersionsAfterDays.
    ExpireVersionsAfterDays int Days to retain a version. Use 0 to never expire by time, or 30 or more to delete versions older than that many days. Required when EnableAutoExpirationVersionTrim="false".
    MajorVersions int Maximum number of major versions to keep. Required when EnableAutoExpirationVersionTrim="false".
    Inherit from Tenant

    Use the version policy that your Microsoft 365 administrator has configured at tenant level. This is the right choice when your organisation has a central IT policy and you want this site to follow it automatically. No other version attributes may be set alongside InheritVersionPolicyFromTenant.

    1
    
    <Site Url="{url}" Title="{title}" OwnerLogin="{owner}" Template="STS#3" InheritVersionPolicyFromTenant="true">
    
    Auto Expiration

    Let SharePoint automatically decide which old versions to clean up using its built-in expiration logic. This is the simplest option, you do not need to specify version counts or expiration days. Recommended when you do not have specific compliance or storage requirements.

    1
    2
    
    <Site Url="{url}" Title="{title}" OwnerLogin="{owner}" Template="STS#3"
      EnableAutoExpirationVersionTrim="true">
    
    Expire After (time-based retention)

    Keep up to a set number of versions, but automatically delete versions that are older than a specified number of days. Use this when you want recent document history without accumulating old versions indefinitely. For example, keeping the last 500 versions from the past 180 days.

    1
    2
    3
    4
    
    <Site Url="{url}" Title="{title}" OwnerLogin="{owner}" Template="STS#3"
      EnableAutoExpirationVersionTrim="false"
      MajorVersions="500"
      ExpireVersionsAfterDays="180">
    
    No Expiration (count-based retention only)

    Keep a fixed number of versions indefinitely. Versions are deleted only when the count exceeds the configured limit, and never on a time basis. Use this for compliance or record-keeping scenarios where you need a predictable version history that is never automatically expired by age.

    1
    2
    3
    4
    
    <Site Url="{url}" Title="{title}" OwnerLogin="{owner}" Template="STS#3"
      EnableAutoExpirationVersionTrim="false"
      ExpireVersionsAfterDays="0"
      MajorVersions="500">
    
  4. Configure sensitivity labels

    You can now assign Microsoft Purview sensitivity labels to SharePoint site by specifying the label GUID via the SensitivityLabelId attribute.

    Add / update sensitivity label

    1
    
    <Site Title="{Title}" Url="{url}" Template="STS#3" LCID="1033" OwnerLogin="{owner}" ObjectAction="Create" SharingCapability="ExternalUserSharingOnly" DenyAddAndCustomizePages="Disabled" SensitivityLabelId="43cd7698-7325-4b15-88ac-21ad1ba1e320">
    

    Remove sensitivity label

    1
    
    <Site Title="{Title}" Url="{url}" Template="STS#3" LCID="1033" OwnerLogin="{owner}" ObjectAction="Create" SharingCapability="ExternalUserSharingOnly" DenyAddAndCustomizePages="Disabled" SensitivityLabelId="">
    

    To get the Id of a sensitivity label, use the PnP PowerShell commandlet Get-PnPAvailableSensitivityLabel. Please see the PnP site for more information about this commandlet: Get-PnPAvailableSensitivityLabel | PnP PowerShell.