Nov 23 2021 09:12 AM
Hello,
I have a requirement to mimic exactly as is as the SharePoint online Prod site with contents and permissions and create a new DEV site. How can I achieve that? Please help to get some pointers or scripts. This is in SharePoint online.
Thanks,
Chirag
Nov 23 2021 09:19 AM
Solution
You can use PnP Powershell to create a site template which you can apply to the DEV site.
Code:
# connect to the prod site
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/prod"
# get the template
Get-PnPSiteTemplate -Out "PnP-Provisioning-File.xml"
# connect to the dev site
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/dev"
# apply the template
Invoke-PnPSiteTemplate -Path "PnP-Provisioning-File.xml"
Nov 29 2021 09:12 AM
Nov 23 2021 09:19 AM
Solution
You can use PnP Powershell to create a site template which you can apply to the DEV site.
Code:
# connect to the prod site
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/prod"
# get the template
Get-PnPSiteTemplate -Out "PnP-Provisioning-File.xml"
# connect to the dev site
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/dev"
# apply the template
Invoke-PnPSiteTemplate -Path "PnP-Provisioning-File.xml"