PowerShell Hack: Apply Out-of-the-Box SharePoint Site Designs to Existing Sites
Introduction
SharePoint site designs are powerful tools for automating site configuration, but they’re typically applied during site creation. What if you need to apply Microsoft’s out-of-the-box site designs to existing sites using automation? The PnP PowerShell, CLI for M365 and other PowerShell module cover applying custom site designs only. We can leverage a PowerShell hack using REST API calls to achieve this functionality. Thanks to Arash Aghajani who pinpointed on feasibility and requested for it to be natively available within PnP PowerShell. However the implementation with PnP PowerShell uses CSOM and does not the option to apply out of the box site design.
Network trace
I used network trace to identify the endpoint and payload.
Endpoint
{webUrl}/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign
Payload
"{`"siteDesignId`": `"$siteDesignId`", `"webUrl`": `"$webUrl`", `"store`": 1}"
The Challenge
Microsoft provides several useful out-of-the-box site designs like:
- Project Management - Adds project-related lists and libraries
- Training Portal - Sets up training-focused site structure
- Team Collaboration - Configures collaboration features
These are available from the UI to apply to a site only. The existing PowerShell modules are lacking the functionality to replicate the behaviour.
The Solution: REST API Hack
By using SharePoint’s REST API through PnP PowerShell as a hack, we can programmatically apply these site designs to existing sites. Here’s how to do it:
Step 1: Get Available Site Designs
First, let’s retrieve all available out-of-the-box site designs:
$webUrl = "https://yourtenant.sharepoint.com/sites/yoursite"
Connect-PnPOnline -Url $webUrl
# Get available site designs from Microsoft's store
$getSiteDesignsUrl = "$webUrl/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteDesigns"
$siteDesigns = (Invoke-PnPSPRestMethod -Url $getSiteDesignsUrl -Method POST -ContentType "application/json" -content "{`"store`": 1}").value | select Id, Title
# Display available designs
$siteDesigns | ForEach-Object { Write-Host "$($_.Id) - $($_.Title)" }
Step 2: Apply the Site Design
Once you have the Site Design ID, apply it to your existing site:
# Example: Project Management site design
$siteDesignId = "b8ef3134-92a2-4c9d-bca6-2f14e79fe98e"
$webUrl = "https://yourtenant.sharepoint.com/sites/yoursite"
# Validate the site design exists
if (-not ($siteDesigns | Where-Object { $_.Id -eq $siteDesignId })) {
Write-Host "Site Design ID not found. Available IDs are:" -ForegroundColor Red
$siteDesigns | ForEach-Object { Write-Host "$($_.Id) - $($_.Title)" }
exit
}
# Apply the site design
$restUrl = "$webUrl/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign"
$body = "{`"siteDesignId`": `"$siteDesignId`", `"webUrl`": `"$webUrl`", `"store`": 1}"
$response = Invoke-PnPSPRestMethod -Url $restUrl -Method Post -ContentType "application/json" -Content $body
Write-Host "Site design applied successfully!" -ForegroundColor Green
Complete Script
Here’s the full script with error handling and validation:
# Configuration
$siteDesignId = "b8ef3134-92a2-4c9d-bca6-2f14e79fe98e" # Project Management
$webUrl = "https://yourtenant.sharepoint.com/sites/yoursite"
try {
# Connect to SharePoint
Connect-PnPOnline -Url $webUrl
Write-Host "Connected to $webUrl" -ForegroundColor Green
# Get available site designs
$getSiteDesignsUrl = "$webUrl/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteDesigns"
$siteDesigns = (Invoke-PnPSPRestMethod -Url $getSiteDesignsUrl -Method POST -ContentType "application/json" -content "{`"store`": 1}").value | select Id, Title
Write-Host "`nAvailable Site Designs:" -ForegroundColor Yellow
$siteDesigns | ForEach-Object { Write-Host " $($_.Id) - $($_.Title)" }
# Validate site design ID
$selectedDesign = $siteDesigns | Where-Object { $_.Id -eq $siteDesignId }
if (-not $selectedDesign) {
Write-Host "`nError: Site Design ID '$siteDesignId' not found!" -ForegroundColor Red
Write-Host "`nAvailable Site Designs:" -ForegroundColor Yellow
$siteDesigns | ForEach-Object { Write-Host " $($_.Id) - $($_.Title)" }
exit 1
}
Write-Host "`nApplying site design: $($selectedDesign.Title)" -ForegroundColor Yellow
# Apply the site design
$restUrl = "$webUrl/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign"
$body = "{`"siteDesignId`": `"$siteDesignId`", `"webUrl`": `"$webUrl`", `"store`": 1}"
$response = Invoke-PnPSPRestMethod -Url $restUrl -Method Post -ContentType "application/json" -Content $body
Write-Host "✅ Site design '$($selectedDesign.Title)' applied successfully!" -ForegroundColor Green
if ($response) {
Write-Host "Response details:" -ForegroundColor Cyan
$response | ConvertTo-Json -Depth 3
}
}
catch {
Write-Host "❌ Error applying site design: $($_.Exception.Message)" -ForegroundColor Red
}
Output
Common Out-of-the-Box Site Design IDs
Here are the complete list of Microsoft out-of-the-box site design IDs you can use:
Site Design | ID | Description |
---|---|---|
Department | 73495f08-0140-499b-8927-dd26a546f26a | Department site structure |
Event planning | 9522236e-6802-4972-a10d-e98dc74b3344 | Event planning and coordination |
Leadership connection | cd4c26b2-b231-419a-8bb4-9b1d9b83aef6 | Leadership communication hub |
Project management | f0a3abf4-afe8-4409-b7f3-484113dee93e | Project tracking and collaboration |
Training course | 695e52c9-8af7-4bd3-b7a5-46aca95e1c7e | Training course delivery |
Training design team | 64aaa31e-7a1e-4337-b646-0b700aa9a52c | Training content development |
Learning central | b8ef3134-92a2-4c9d-bca6-c2f14e79fe98 | Centralized learning resources |
New employee onboarding | 2a23fa44-52b0-4814-baba-06fef1ab931e | Employee onboarding process |
Blank | f6cc5403-0d63-442e-96c0-285923709ffc | Blank site template |
Showcase | 6142d2a0-63a5-4ba0-aede-d9fefca2c767 | Product or service showcase |
Retail management team | e4ec393e-da09-4816-b6b2-195393656edd | Retail operations management |
Store collaboration | 811ecf9a-b33f-44e6-81bd-da77729906dc | Store team collaboration |
Employee onboarding team | af9037eb-09ef-4217-80fe-465d37511b33 | Onboarding team coordination |
Set up your home page | 33537eba-a7d6-4d76-96cc-ee1930bd3907 | Home page configuration |
Crisis communication team | fb513aef-c06f-4dc3-b08c-963a2d2360c1 | Emergency communication |
IT help desk | 71308406-f31d-445f-85c7-b31942d1508c | IT support and ticketing |
Contracts management | 2a7dd756-75f6-4f0f-a06a-a672939ea2a3 | Contract lifecycle management |
Accounts payable | 403ffe4e-12d4-41a2-8153-208069eaf2b8 | Finance and accounts payable |
Brand central | f2c6bb0c-9234-40c2-9ec3-ee86a70330fb | Brand assets and guidelines |
Standard team | c8b3137a-ca4c-48a9-b356-a8e7987dd693 | Standard team collaboration |
Standard communication | 96c933ac-3698-44c7-9f4a-5fd17d71af9e | Communication site template |
Crisis management | 951190b8-8541-4f8c-8e8a-10a17c466c94 | Crisis response management |
Event | 3d5ef50b-88a0-42a7-9fb2-8036009f6f42 | Event management and coordination |
Human resources | c298ddc9-628d-48bf-b1e5-5939a1962fb1 | HR processes and resources |
Organization home | 30eebaf6-48ea-4af9-a564-a5c50297c826 | Organizational hub |
Volunteer center | 34a39504-194c-4605-87be-d48d00070c67 | Volunteer coordination |
Copilot Campaign | 94e24f52-dfaf-40e4-b629-df2c85570adc | Microsoft Copilot campaign |
Viva Campaign | da99c5d9-baad-4e81-81f6-03a061972d49 | Microsoft Viva campaign |
Note: These IDs are from Microsoft’s out-of-the-box site designs. You can also retrieve the current list by running the PowerShell script above to query your tenant’s available designs.
What Gets Applied?
When you apply a site design, it typically includes:
- Lists and Libraries - Pre-configured with relevant columns
- Site Navigation - Updated to include new areas
- Web Parts - Added to pages where appropriate
- Permissions - Applied according to the design template
- Theme and Branding - Visual consistency with the design
Troubleshooting
Common Issues
Error: “Access Denied”
- Ensure you have Site Collection Administrator or Site Owner permissions
- Check if the site has custom permission configurations
Error: “Site Design not found”
- Verify the Site Design ID is correct
- Ensure you’re connected to the right tenant
Partial Application
- Some site designs may partially apply if conflicts exist
- Check the response object for detailed results
Conclusion
This PowerShell hack provides a powerful way to retrofit existing SharePoint sites with Microsoft’s out-of-the-box site designs. While not officially documented, it leverages the same REST API calls that the SharePoint interface uses internally.
Key Benefits:
- ✅ Apply professional site structures to existing sites
- ✅ Automate site configuration across multiple sites
- ✅ Leverage Microsoft’s tested and optimized designs
- ✅ Save time compared to manual configuration
Remember:
- Always test in a development environment first
- Monitor the results and train users on new features