GitHub Icon Image

Create Communication Sites with a specific primary language

Summary

Do you want to create a Communication Site in another language? This script will show you how by creating a modern site with the primary language set to a language other than English.

Example Screenshot

Note

Once you create a site in the primary language you cannot change it, however you can add support for other languages.

  • PnP PowerShell
  • SPO Management Shell
  • CLI for Microsoft 365 with PowerShell

$adminUrl = "https://<tenant>-admin.sharepoint.com"
$newSiteUrl = "https://<tenant>.sharepoint.com/sites/Pensaerniaeth" 
$ownerEmail = "<your.name@your.email.com>"

$siteTitle = "Pensaerniaeth"                # Translates to "Architecture" - Bing Translator
$siteTemplate = "SITEPAGEPUBLISHING#0"      # Communication Site Template
$lcid = 1106                                # Welsh
$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

Write-Host "Script Complete! :)" -ForegroundColor Green

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

$adminUrl = "https://<tenant>-admin.sharepoint.com"
$newSiteUrl = "https://<tenant>.sharepoint.com/sites/Pensaerniaeth" 
$ownerEmail = "<your.name@your.email.com>"

$siteTitle = "Pensaerniaeth"                # Translates to "Architecture" - Bing Translator
$siteTemplate = "SITEPAGEPUBLISHING#0"      # Communication Site Template
$lcid = 1106                                # Welsh
$timeZone = 2                               # London
$storageQuota = 1000

Connect-SPOService $adminUrl
New-SPOSite -Template $siteTemplate -Title $siteTitle -Url $newSiteUrl `
        -LocaleId $lcid -Owner $ownerEmail -TimeZoneId $timeZone -StorageQuota $storageQuota

Write-Host "Script Complete! :)" -ForegroundColor Green

Check out the SPO Management Shell to learn more at: Introduction SharePoint Online Management Shell | Microsoft Docs


$newSiteUrl = "https://<tenant>.sharepoint.com/sites/Pensaerniaeth"
$siteTitle = "Pensaerniaeth"
$lcid = 1106

$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}
m365 spo site add --type CommunicationSite --url $newSiteUrl --title $siteTitle --lcid $lcid

Write-Host "Script Complete! :)" -ForegroundColor Green

Check out the CLI for Microsoft 365 to learn more at: https://aka.ms/cli-m365

To see a list of LCIDs, check out the sample Generate Markdown Report of LCIDs to see the full list

Source Credit

Article first appeared on https://www.pkbullock.com/blog/2018/create-communication-sites-with-a-specific-primary-language-using-pnp-powershell/

Contributors

Author(s)
Paul Bullock
Adam Wójcik

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Back to top Script Samples
Generated by DocFX with Material UI