Pnp-powershell: SPO site regional settings

Created on 1 May 2018  路  4Comments  路  Source: pnp/PnP-PowerShell

Question:

I have a number of SPO modern sites that I would like to get their regional settings e.g. TimeZone and Locale.

Is this possible with PnP cmdlets?

Cheers

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [x] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.24.1803.0

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [ ] Installed through the PowerShell Gallery with Install-Module
  • [X] Other means

Most helpful comment

You can get those properties from RootWeb.
At least like this, you can get those site by site.

Connect-PnPOnline https://<your tenant>/sites/<site url>
$web = Get-PnPWeb -Includes RegionalSettings,RegionalSettings.TimeZone
$web.RegionalSettings.LocaleId
$web.RegionalSettings.TimeZone
Disconnect-PnPOnline

All 4 comments

Yes. Here is an example:

Connect-PnPOnline -Url https://<yourtenant>.sharepoint.com
Get-PnPTenantSite | Where-object {$_.Template -eq "SITEPAGEPUBLISHING#0" -or $_.Template -eq "GROUP#0"} | select Title, Url, Lcid, TimeZoneId, Template | out-gridview

It will return modern team sites (GROUP#0) and communication sites (SITEPAGEPUBLISHING#0).

Reference for TimeZoneId's can be found here: https://msdn.microsoft.com/library/microsoft.sharepoint.spregionalsettings.timezones.aspx

@mpaukkon Thanks! Unfortunately I am not authorized to use the Get-PnPTenantSite cmd. I am the owner of the specific sites.
I have tried getting the properties via Get-PnPSite but show blank when requested. Any ideas?

You can get those properties from RootWeb.
At least like this, you can get those site by site.

Connect-PnPOnline https://<your tenant>/sites/<site url>
$web = Get-PnPWeb -Includes RegionalSettings,RegionalSettings.TimeZone
$web.RegionalSettings.LocaleId
$web.RegionalSettings.TimeZone
Disconnect-PnPOnline

@mpaukkon Perfect! Thanks.

Was this page helpful?
0 / 5 - 0 ratings