Site Script Generator
Build SharePoint site scripts visually — add actions, configure settings, and export JSON site scripts with PowerShell deployment commands.
Site Design Title
Add Actions
Actions (0)
Click an action above to add it to your site script
Site scripts and site designs
A site scriptis a JSON document listing provisioning actions — create this list, add these columns, apply that theme. A site design is the package that references one or more scripts and gives them a name in the site creation dialog. The split matters because scripts are reusable: a standard document-library script can be referenced by several designs rather than copied into each one.
They run after the site exists, not during creation
This is the behaviour that surprises people. Site creation returns as soon as the site exists; the design then runs asynchronously against it. The user lands on a site that is still being built, watches lists appear, and reports a bug. For anything beyond a couple of actions, tell people the site will finish configuring itself, and do not chain automation that assumes the design has already completed.
Failures are quiet — go looking for them
A failed action does not roll the site back and is easy to miss. Get-SPOSiteDesignRun lists the design runs for a site and Get-SPOSiteDesignRunStatusreturns per-action outcomes for a given run. That pair is the first thing to reach for when a site “didn't get its columns”. Re-running a design against an existing site with Invoke-SPOSiteDesign is both how you apply a design retrospectively and the usual fix once you have found the failure.
Preconditions the schema will not check
applyThemerequires that the theme already exists in the tenant — it references a theme by name and fails if nobody ran Add-SPOTheme first. installSolution expects the solution to be in the app catalogue already. joinHubSite needs the hub registered and the caller entitled to join it. None of these are validated when the script is added, so a script that passes Add-SPOSiteScript cleanly can still fail every run in a tenant missing a prerequisite.
When the simple verbs are not enough
addSPFieldcovers common column types with a handful of properties. Anything beyond that — a calculated column's formula, validation, a specific choice rendering, a precise field GUID — needs addSPFieldXml, which takes a raw <Field /> CAML definition. It is more verbose and considerably more capable, and it is also the route to a stable internal name rather than whatever SharePoint derives from the display name.
Do not commit a triggerFlow URL
The triggerFlow verb takes the HTTP trigger URL of a Power Automate flow. That URL embeds a shared access signature, so anyone holding it can invoke the flow. It is a credential, not an address. Keep it out of the repository, and rotate it if it has ever been committed or pasted into a ticket.
Where site designs stop
Scripts have a documented ceiling on how many actions each may contain, so large provisioning jobs are split across several scripts referenced by one design rather than packed into one file. More importantly, site designs deliberately cover a bounded set of verbs. If you need content types pushed from a hub, permission structures, sample content, or anything conditional, you have reached their edge — PnP provisioning templates handle all of it and can run from a pipeline. A reasonable pattern is a site design for what must happen at creation time and a PnP template for the rest.
Frequently Asked Questions
Site Scripts are JSON files that define a set of provisioning actions (creating lists, applying themes, setting navigation, adding site columns) that run automatically when a new SharePoint site is created or when manually applied to an existing site.
Use PowerShell: (1) Upload the JSON with Add-SPOSiteScript, (2) Bundle it into a Site Design with Add-SPOSiteDesign, (3) Users select it when creating a new site, or you apply it to existing sites with Invoke-SPOSiteDesign.
Site scripts support: creating lists/libraries, adding site columns, applying themes, setting the site logo/header, installing SPFx solutions, configuring navigation, enabling site features, and triggering Power Automate flows for complex provisioning.
Site scripts are lightweight, natively integrated into the SharePoint UI, and maintained by Microsoft — ideal for standardizing new sites. PnP provisioning templates are more powerful for complex scenarios (content types, term sets, full site cloning) but require PowerShell execution.
A single site script is limited to 300 actions and 100KB file size. A site design can reference up to 9 site scripts. Scripts run asynchronously and may take several minutes to complete on large sites.
Yes! Use the triggerFlow action to call a Power Automate flow with an HTTP trigger. This is extremely powerful — it lets you perform actions that site scripts cannot do natively, like creating Teams channels, setting permissions, or sending notifications.
Yes. When a Microsoft Teams team is created, it provisions a SharePoint team site behind it. You can apply site scripts to these sites to standardize document libraries, add custom lists, or apply branding automatically for every new team.