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
2.24.1803.0
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.
Most helpful comment
You can get those properties from RootWeb.
At least like this, you can get those site by site.