Forum Discussion

Renato Rossetti's avatar
Renato Rossetti
Copper Contributor
Jan 28, 2019
Solved

workaround | copy a layout from an existing sharepoint team site

we need to create hundreds of SharePoint team site (powershell) and the layout must be identical, can be possible create a new team site using an existing one as a template or exporting and importing...
  • Matt Weston's avatar
    Jan 28, 2019

    Hi Renato Rossetti 

     

    You could use PnP Provisioning Templates which should do the job quite nicely for you.

     

    Ensure you have the pre-reqs installed (https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps installed) and then follow the high level description below:

     

    1. Create your template using the SharePoint UI
    2. Export the template using the https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpprovisioningtemplate?view=sharepoint-ps cmdlet
    3. Create your new site collection
    4. Apply the template using the https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/apply-pnpprovisioningtemplate?view=sharepoint-ps cmdlet

    Build steps 3 and 4 into a loop so that it will repeat as you need it to.

     

    I've used this same approach a number of times, so happy to help if you get stuck. Just worth while thinking about any complexities that might be on the site in terms of syndicated content types, customisations and workflows as that may need a little bit of additional work.

Resources