0

I'm currently using this command to create new SharePoint modern communication sites:

New-PnPSite -Type CommunicationSite -Owner [email protected] -SiteDesign Blank -Lcid 1044 -Title "My site" -Url https://acme.sharepoint.com/sites/my_site

I've yet to find how to set the timezone for new sites, as there doesn't seem to be no timezone flag. Is there anything I'm missing here? How does others set timezone for new sites?

1

2 Answers 2

2

You could use use New-SPOSite to create new SharePoint modern communication sites with timezone:

New-SPOSite -Url https://acme.sharepoint.com/sites/my_site -Owner [email protected] -Template "SITEPAGEPUBLISHING#0" -StorageQuota 2048 -Title "Communication" -TimeZoneId 13 -LocaleID 1044

References: https://www.sharepointdiary.com/2016/06/sharepoint-online-create-site-collection-using-powershell.html

https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/new-sposite?view=sharepoint-ps

2
  • Thanks, it worked.
    – kenneho
    Commented Mar 31, 2020 at 9:41
  • You could accept the answer if it helps you:) Commented Mar 31, 2020 at 9:47
2

Using PnP-PowerShell, you can do it like below:

$adminUrl = "https://<tenant>-admin.sharepoint.com"
$newSiteUrl = "https://<tenant>.sharepoint.com/sites/Pensaerniaeth" 
$ownerEmail = "<[email protected]>"

$siteTitle = "Pensaerniaeth"                # Translates to "Architecture" - Bing Translator
$siteTemplate = "SITEPAGEPUBLISHING#0"      # Communication Site Template
$lcid = 1106                                # Welsh (https://capa.ltd/mui-lcids)
$timeZone = 2                               # London (https://capa.ltd/sp-timezones)

Connect-PnPOnline -Url $adminUrl -NoTelemetry
New-PnPTenantSite -Template $siteTemplate -Title $siteTitle -Url $newSiteUrl -Lcid $lcid -Owner $ownerEmail -TimeZone $timeZone

Reference:

Create Communication Sites with a specific primary language using PnP PowerShell.

4
  • Thansk, but New-PnPTenantSite seems to create classic sites only, while I'm looking to create modern sites.
    – kenneho
    Commented Mar 24, 2020 at 6:26
  • I have tried using this command to create communication site and it works fine. try it and let me know if you found any issue (don't get confused because of documentation). Commented Mar 24, 2020 at 11:38
  • Thanks, it did in fact work. Strange, because when I tried it some days ago I got a classic site. I assume it's the "template" flag that made the difference, in that perhaps the command defaults to classic site when no flag i provided (which was the case for my test a few days ago). "New-SPOsite" seems to work fine as well though.
    – kenneho
    Commented Mar 31, 2020 at 9:24
  • How can I GET the TimeZone value returned for a single site and all sites in a tenant? Ideally, I want to run a query that returns all sites that do not have a specific timezone id. I am looking at this reference (pnp.github.io/powershell/cmdlets/Get-PnPTenantSite.html) and when running Get-PnPTenantSite -Identity $identity -Detailed I still only get 3 values returned Url, Template and LocaleId. Not sure if it makes any difference, but the site in this case is a Teams SharePoint site. Commented Feb 8, 2023 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.