SharePoint Site Scripts & Provisioning
Essential guide to SharePoint site scripts, provisioning automation, and site design setup for modern flat-architecture sites with PnP PowerShell.

The 2026 Landscape of SharePoint Provisioning
In 2026, SharePoint site provisioning has evolved significantly. The days of deeply nested subsites are long gone. Modern architecture demands flat hierarchies, driven by Hub Sites and robust metadata. Moreover, with the rise of Microsoft 365 Copilot, how you provision and structure your sites directly impacts the quality of AI-generated responses.
This developer's guide covers the three pillars of modern SharePoint site provisioning: PnP PowerShell, declarative Site Scripts, and the REST API.
---
Pillar 1: PnP PowerShell for Bulk Operations
PnP PowerShell remains the gold standard for complex, scripted provisioning. Its capabilities extend far beyond native cmdlets, offering granular control over lists, content types, and permissions. When you need to stand up dozens of project sites with consistent taxonomy, PnP is your go-to tool.
However, writing repetitive PnP scripts from scratch is inefficient. To streamline this process, use our PnP PowerShell Generator. This tool allows you to visually configure your site requirements and instantly outputs the exact PnP script needed, saving hours of manual coding.
---
Pillar 2: Declarative Site Scripts and Site Designs
For self-service provisioning directly within the SharePoint UI, Site Scripts (now often integrated with modern templates) are essential. These JSON-based declarative files tell SharePoint exactly what to build—from applying themes to creating specific document libraries—the moment a user clicks "Create site."
Writing Site Scripts: A Practical Example
A basic Site Script that creates a document library with a custom content type and applies a theme looks like this:
``
json
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
"actions": [
{
"verb": "createContentType",
"name": "Project Documents",
"description": "Content type for project-related documents",
"parentContentType": "Document",
"fieldsToAdd": [
{
"fieldType": "Text",
"displayName": "Project Code",
"internalName": "ProjectCode",
"required": true
}
]
},
{
"verb": "createSPList",
"listName": "Project Deliverables",
"templateType": 101,
"subactions": [
{
"verb": "addContentTypeToList",
"contentTypeId": "0x01009"
},
{
"verb": "addSPField",
"internalName": "DueDate",
"displayName": "Delivery Date",
"fieldType": "DateTime",
"additionalProperties": {
"FieldTypeKind": 4
}
}
]
},
{
"verb": "applyTheme",
"name": "Blue Marble"
}
]
}
`
Building these JSON structures manually is error-prone. A missing comma or incorrect verb can break the entire flow. Instead of wrestling with syntax, try our Site Script Generator to visually construct your declarative provisioning logic and generate valid JSON instantly.
Hub Site Association & Site Script Automation
Once your site is provisioned, you can automatically register it with a Hub Site using Site Scripts. This creates a unified navigation experience and shared governance across related sites:
`json
{
"verb": "associateHubSite",
"hubSiteId": "{your-hub-site-id}",
"name": "Sales Hub"
}
`
This is particularly powerful in multi-tenant scenarios where you're standing up dozens of departmental sites that need to roll up under a single hub.
---
Pillar 3: The SharePoint REST API
Sometimes you need to provision resources programmatically from a custom application, a Power Automate flow, or an Azure Function. The SharePoint REST API provides the direct endpoints needed to create sites, lists, and items over HTTP.
REST API Provisioning Patterns
Creating a list via REST API using a POST request:
`typescript
const siteUrl = 'https://yourtenant.sharepoint.com/sites/marketing';
const listTitle = 'Campaign Assets';
const response = await fetch(${siteUrl}/_api/web/lists, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-RequestDigest': await getRequestDigest(siteUrl)
},
body: JSON.stringify({
__metadata: { type: 'SP.List' },
Title: listTitle,
BaseTemplate: 101, // Document Library
Description: 'Centralized storage for campaign creative assets'
})
});
const list = await response.json();
console.log(List created with ID: ${list.Id});
``
You can also bulk-provision multiple lists, configure column settings, and set up permissions—all over REST. This pattern is especially useful in Power Automate flows where you're provisioning resources on-demand.
Common Automation Patterns
A typical enterprise provisioning workflow combines all three pillars:
- User initiates a "New Project Site" request via a Power Automate portal page
- PnP PowerShell validates requirements and checks naming conventions
- Site Scripts apply consistent libraries, content types, and branding
- REST API calls (via Power Automate) wire up downstream integrations (e.g., sync metadata to Dataverse, trigger additional workflows)
If you are building custom data retrieval alongside provisioning, our REST API Builder helps you construct correct URI endpoints. Furthermore, if you are querying list data within these custom apps, the CAML Query Builder is invaluable for generating precise XML filters.
---
FAQ: Modern Architecture
Should I use subsites or a flat architecture?
Always use a flat architecture. Nested subsites create rigid security boundaries and break modern hub navigation. Microsoft strongly recommends flat sites connected via Hub Sites for maximum flexibility and Copilot compatibility.
How does provisioning affect Microsoft Copilot?
Copilot relies on the Microsoft Graph to understand context. Consistently provisioned sites with standardized content types and metadata ensure Copilot surfaces accurate, high-quality answers instead of irrelevant legacy documents.
---
Next Steps: Post-Provisioning Customization
Once your site is provisioned, the next challenge is making the data look good. Out-of-the-box SharePoint lists can look plain.
To transform standard list views into interactive, visually appealing dashboards without writing code, use our JSON Column Formatter. It's the perfect finishing touch for any newly provisioned modern SharePoint site.
For scenarios where traditional SharePoint sites don't fit your architectural requirements, consider SharePoint Embedded containers as an alternative storage model for specialized applications and third-party integrations.