Below is the sample PowerShell commands: $adminSiteUrl = "tenantname-admin.sharepoint.com/" $siteUrl = "tenantname.sharepoint.com/sites/sitename" $relativeListUrls = "/lists/Project Tracking", "/lists/Issue tracking", "/lists/Announcements" Connect-SPOService $adminSiteUrl //extract the site script $extracted = Get-SPOSiteScriptFromWeb -WebUrl $siteUrl -IncludeTheme -IncludeBranding -IncludeSiteExternalSharingCapability -IncludeRegionalSettings -IncludeLinksToExportedItems -IncludedLists $relativeListUrls Add-SPOSiteScript -Title "My Custom template " ` -Description "This is a copy of a site collection." ` -Content $extracted Add-SPOSiteDesign -Title "Custom Template" -WebTemplate "64" -SiteScripts "" -Description "Applying Team site"
2 роки тому+3
This video has been of great help to me. It helps me solve an important problem with several clients. It is the best and most complete tutorial I have found. Thanks.
You can delete the design using command : Remove-SPOSiteDesign "" You may get the ID of design using below command: Get-SPOSiteDesign | select Id, Title, Description
Very nice video! Thanks! It would be interesting to also see how this is done with REST. And btw does REST also extract Layout and Web Part info? Because I noticed that Site Design doesn't :/ Yet again, thanks for a great guide. //A
hi Alexander, Site design does not extract modern pages layouts & webpart as of now but MS is adding more Operation to it so hopefully some day, we will get options to add pages & web parts. REST will also not be able to extract layout & webpart as its just another way to work in Site Scripts & Design instead of PowerShell. PnP Provisioning Schema will give you more options to do so. You can have a look on sample schema at : docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
Below is the sample PowerShell commands:
$adminSiteUrl = "tenantname-admin.sharepoint.com/"
$siteUrl = "tenantname.sharepoint.com/sites/sitename"
$relativeListUrls = "/lists/Project Tracking", "/lists/Issue tracking", "/lists/Announcements"
Connect-SPOService $adminSiteUrl
//extract the site script
$extracted = Get-SPOSiteScriptFromWeb -WebUrl $siteUrl -IncludeTheme -IncludeBranding -IncludeSiteExternalSharingCapability -IncludeRegionalSettings -IncludeLinksToExportedItems -IncludedLists $relativeListUrls
Add-SPOSiteScript -Title "My Custom template " `
-Description "This is a copy of a site collection." `
-Content $extracted
Add-SPOSiteDesign -Title "Custom Template" -WebTemplate "64" -SiteScripts "" -Description "Applying Team site"
This video has been of great help to me. It helps me solve an important problem with several clients. It is the best and most complete tutorial I have found. Thanks.
Glad it helped!
This is excellent. Thank you! One question i have is how do we differentiate between a list and a library please?
Thank you very much sir, how do we then go about deleting the design once created?
You can delete the design using command :
Remove-SPOSiteDesign ""
You may get the ID of design using below command:
Get-SPOSiteDesign | select Id, Title, Description
Very nice video! Thanks!
It would be interesting to also see how this is done with REST. And btw does REST also extract Layout and Web Part info? Because I noticed that Site Design doesn't :/
Yet again, thanks for a great guide.
//A
hi Alexander, Site design does not extract modern pages layouts & webpart as of now but MS is adding more Operation to it so hopefully some day, we will get options to add pages & web parts. REST will also not be able to extract layout & webpart as its just another way to work in Site Scripts & Design instead of PowerShell. PnP Provisioning Schema will give you more options to do so. You can have a look on sample schema at : docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
Can this design will have it's own template I'd for further automation?
Yes , it does. When you add the design , it returns ID which can be used further for updating the same design or removing it in future.
Thanks again, but I see this method excludes other custom webparts and existing text content. Is there a way to extract that info as well?
There is another video in my channel explaining custom solution inside SPO designs
ua-cam.com/video/nf3bqtNvSGs/v-deo.html
it does not move the library content pics , used to customize the site. how to include the folder content in PowerShell
@m365techhelp How to include the site assets library containing the photos used in webparts
But this template is available in all site collections do we have any option to create template at site collection level instead on tenant level
Thanks! I would like to use this but I don't see the script in the comments
Below is the sample PowerShell commands:
$adminSiteUrl = "tenantname-admin.sharepoint.com/"
$siteUrl = "tenantname.sharepoint.com/sites/sitename"
$relativeListUrls = "/lists/Project Tracking", "/lists/Issue tracking", "/lists/Announcements"
Connect-SPOService $adminSiteUrl
//extract the site script
$extracted = Get-SPOSiteScriptFromWeb -WebUrl $siteUrl -IncludeTheme -IncludeBranding -IncludeSiteExternalSharingCapability -IncludeRegionalSettings -IncludeLinksToExportedItems -IncludedLists $relativeListUrls
Add-SPOSiteScript -Title "My Custom template " `
-Description "This is a copy of a site collection." `
-Content $extracted
Add-SPOSiteDesign -Title "Custom Template" -WebTemplate "64" -SiteScripts "" -Description "Applying Team site"
Hi, need some help with approval workflow.