diff --git a/README.md b/README.md index da40303..b248484 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,50 @@ - -# SharePoint Provisioning Templates - -Repository for SharePoint PnP Provisioning templates to automate site / tenant level provisioning logic. Templates are divided on different folders based on the structure and needed permissions. - -- Site - These templates contain site level provisioning logic. They can be provisioned and used by any site collection administrator and no tenant scoped permissions are needed. - -- Tenant - These templates contain tenant level provisioning. They could contain for example multiple site collections, site designs, taxonomy configurations etc. You will need to have tenant level permissions to apply these templates. - -Sub folders in specific folders are actual templates. Each template has at least one screenshot file and readme file. The readme file should follow the readme template available in the root of this repository. Each template also has a mandatory json file, which has to follow the provided json file structure. This json file information is used to surface metadata on a web site from where the templates can be used. - -# Contributing - -This project welcomes contributions and suggestions on service texts, but not for the templates. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - +# My SharePoint Site + +https://nology897.sharepoint.com/sites/ContosoWorksSite + +# Applying Template Script + +Import-Module PnP.PowerShell + +$baseUrl = Read-Host "Enter base URL for SharePoint (e.g. https://tenant.sharepoint.com/sites/)" +$baseTitle = Read-Host "Enter Site Name" +$baseDescription = "Description for " +$siteNumber = [int] (Read-Host "Enter # of sites to be generated") +$siteOwner = Read-Host "Enter site owner user" +$adminSiteUrl = Read-Host "Enter Admin SharePoint URL" +$templatePath = Read-Host "Enter Path to template" +$credential = Get-Credential +Connect-PnPOnline -Url $adminSiteUrl -Credentials $credential + +for ($i = 1; $i -le $siteNumber; $i++) { + $siteTitle = "$baseTitle$i" + $siteUrl = "$baseUrl$siteTitle" + $siteDescription = "$baseDescription$siteTitle" + +try { +Write-Host "Creating site: $siteTitle at URL $siteUrl" +New-PnPSite -Type CommunicationSite -Title $siteTitle -Url $siteUrl -Lcid 1033 -Description $siteDescription -Owner $siteOwner +Write-Host "Site creation in progress for: $siteUrl" +} +catch { +Write-Host "Failed to create site: $siteUrl. Error: $\_" +continue +} + +Start-Sleep -Seconds 120 + +Connect-PnPOnline -Url $siteUrl -Interactive + +try { +Write-Host "Applying template to site: $siteUrl" +Invoke-PnPSiteTemplate -Path $templatePath +Write-Host "Template applied to site: $siteUrl" +} +catch { +Write-Host "Failed to apply template to site: $siteUrl. Error: $\_" +} + +Start-Sleep -Seconds 10 +} + +Disconnect-PnPOnline diff --git a/tenant/contosoworks/source/template.xml b/tenant/contosoworks/source/template.xml index b27cd43..aee55ae 100644 --- a/tenant/contosoworks/source/template.xml +++ b/tenant/contosoworks/source/template.xml @@ -447,74 +447,114 @@ News Year's Day Corporate Holidays United States - 12/31/2018 4:00 PM - 7/1/2019 4:59 PM + 31/12/2024 4:00 PM + 7/1/2025 4:59 PM Yes Martin Luther King Day Corporate Holidays United States - 1/19/2020 4:00 PM - 1/20/2020 3:59 PM + 19/1/2024 4:00 PM + 20/1/2024 3:59 PM Yes New Year's Day Corporate Holidays United States - 12/31/2019 4:00 PM - 1/1/2020 3:59 PM + 31/12/2024 4:00 PM + 1/1/2025 3:59 PM Yes Memorial Day Corporate Holidays United States - 5/24/2020 5:00 PM - 5/25/2020 4:59 PM + 24/5/2024 5:00 PM + 25/5/2024 4:59 PM Yes Presidents day Corporate Holidays United States - 2/16/2020 4:00 PM - 2/17/2020 3:59 PM + 16/2/2024 4:00 PM + 17/2/2024 3:59 PM Yes Independence day Corporate Holidays United States - 7/2/2020 5:00 PM - 7/3/2020 4:59 PM + 2/7/2024 5:00 PM + 3/7/2024 4:59 PM Yes Labor Day Corporate Holidays United States - 9/6/2020 5:00 PM - 9/7/2020 4:59 PM + 6/9/2024 5:00 PM + 7/9/2024 4:59 PM Yes Thanksgiving Day and Day after Thanksgiving Corporate Holidays United States - 11/25/2020 4:00 PM - 11/27/2020 3:59 PM + 25/11/2024 4:00 PM + 27/11/2024 3:59 PM Yes Christmas Eve and Christmas Day Corporate Holidays United States - 12/23/2020 4:00 PM - 12/25/2020 3:59 PM + 23/12/2024 4:00 PM + 25/12/2024 3:59 PM Yes + + Australia Day + Corporate Holidays + Australia + 26/1/2025 12:00 AM + 26/1/2025 11:59 PM + Yes + + + Waitangi Day + Corporate Holidays + New Zealand + 6/2/2025 12:00 AM + 6/2/2025 11:59 PM + Yes + + + ANZAC Day + Corporate Holidays + Australia, New Zealand + 25/4/2025 12:00 AM + 25/4/2025 11:59 PM + Yes + + + Queen's Birthday (Australia) + Corporate Holidays + Australia + 9/6/2025 12:00 AM + 9/6/2025 11:59 PM + Yes + + + Labour Day (New Zealand) + Corporate Holidays + New Zealand + 27/10/2025 12:00 AM + 27/10/2025 11:59 PM + Yes + @@ -543,8 +583,8 @@ - - + + United States @@ -553,6 +593,8 @@ United States United Kingdom Singapore + Australia + New Zealand @@ -560,26 +602,62 @@ United States New Year's Eve - 1/1/2019 12:00 AM - 1/1/2020 12:00 AM + 1/1/2024 12:00 AM + 1/1/2025 12:00 AM United States Martin Luther King Day - 1/21/2019 12:00 AM - 1/20/2020 12:00 AM + 21/1/2024 12:00 AM + 20/1/2025 12:00 AM United States President's Day - 2/18/2019 12:00 AM - 2/17/2020 12:00 AM + 18/2/2024 12:00 AM + 17/2/2025 12:00 AM United States Memorial Day - 5/27/2019 12:00 AM - 5/25/2020 12:00 AM + 27/5/2024 12:00 AM + 27/5/2025 12:00 AM + + + Australia + New Year's Day + 1/1/2024 12:00 AM + 1/1/2025 12:00 AM + + + Australia + Australia Day + 1/26/2024 12:00 AM + 1/26/2025 12:00 AM + + + Australia + ANZAC Day + 4/25/2024 12:00 AM + 4/25/2025 12:00 AM + + + New Zealand + New Year's Day + 1/1/2024 12:00 AM + 1/1/2025 12:00 AM + + + New Zealand + Waitangi Day + 2/6/2024 12:00 AM + 2/6/2025 12:00 AM + + + New Zealand + ANZAC Day + 4/25/2024 12:00 AM + 4/25/2025 12:00 AM