Regional settings for SharePoint site Using PnP site Provisioning.

%3CLINGO-SUB%20id%3D%22lingo-sub-2725534%22%20slang%3D%22en-US%22%3ERegional%20settings%20for%20SharePoint%20site%20Using%20PnP%20site%20Provisioning.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2725534%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EWe%20are%20doing%20site%20provisioning%20through%20site%20script%20where%20where%20power%20automate%20is%20being%20called%20for%20creating%20Azure%20storage%20queque%20and%20invoking%20pnp%20provisiong%20command%20throught%20Azure%20pnp%20powershell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInvoke-PnPSiteTemplate%20-Path%20%22C%3A%5CtemplateCustom.xml%22%20-ResourceFolder%20%22C%3A%5C%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20this%20set%20up%20is%20for%20one%20language%20template%20DE%20then%20we%20are%20able%20to%20manage%20locale%20and%20regional%20setting%20by%20explicitely%20calling%20this%20action%20in%20SiteScript%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22verb%22%3A%20%22setRegionalSettings%22%2C%3CBR%20%2F%3E%22timeZone%22%3A%204%2C%3CBR%20%2F%3E%22locale%22%3A%201031%2C%3CBR%20%2F%3E%22sortOrder%22%3A%2025%2C%3CBR%20%2F%3E%22hourFormat%22%3A%20%2224%22%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20we%20want%20to%20extend%20this%20for%20multiple%20language%20and%20for%20that%20we%20have%20created%20separate%20pnp%20template%20for%20EN%20and%20RO%20and%20calling%20invoke%20pnp%20command%20by%20checking%20language%20ID%20on%20PnP%20powershell%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif(%24languageID%20-eq%201031)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EWrite-Output%20%22Connected%20to%20DE%20site%22%3CBR%20%2F%3EInvoke-PnPSiteTemplate%20-Path%20%22D%3A%5CTemplateDE.xml%22%20-ResourceFolder%20%22D%3A%5C%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3Eelseif(%24languageID%20-eq%201033)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EWrite-Output%20%22Connected%20to%20EN%20site%22%3CBR%20%2F%3EInvoke-PnPSiteTemplate%20-Path%20%22D%3A%5CTemplateEN.xml%22%20-ResourceFolder%20%22D%3A%5C%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3Eelseif(%24languageID%20-eq%201048)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EWrite-Output%20%22Connected%20to%20RO%20site%22%3CBR%20%2F%3EInvoke-PnPSiteTemplate%20-Path%20%22D%3A%5CTemplateRO.xml%22%20-ResourceFolder%20%22D%3A%5C%22%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20problem%20here%20is%20that%20i%20can%20not%20keep%20above%20regional%20settings%20in%20site%20script%20otherwise%20it%20will%20always%20set%20same%20regional%20settings%20here.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20i%20am%20removing%20setregionalsettings%20action%20from%20site%20script%20then%20also%20default%20regional%20setting%20of%20UTC%208%3A00%20with%20locale%20DE%20is%20getting%20set.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20we%20apply%20the%20template%20using%20the%20below%20command%20directly%20without%20using%20site%20script%20from%20PnP%20powershell%20regional%20settings%20are%20applied%20according%20to%20source%20template%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-PnPOnline%20-URL%20%22BaseTemplateSiteURL%22%3CBR%20%2F%3EGet-PnPSiteTemplate%20-Out%20%22D%3A%5CtemplateCustom.xml%22%20-Handlers%20%22Lists%22%20-ExcludeHandlers%20%22SiteSecurity%2CTermGroups%2CFields%2CContentTypes%2CNavigation%22%20-PersistBrandingFiles%20-IncludeAllPages%20-Force%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EConnect-PnPOnline%20-URL%20%22CustomTemplateAppliedSiteURL%22%3CBR%20%2F%3EInvoke-PnPSiteTemplate%20-Path%20%22C%3A%5CtemplateCustom.xml%22%20-ResourceFolder%20%22C%3A%5C%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3Ebut%2C%20when%20we%20are%20applying%20the%20template%20using%20the%20siteScript%2C%20the%20default%20regional%20settings%20for%20the%20selected%20language%20not%20applied.%3C%2FP%3E%3CP%3EThanks%2C%3CBR%20%2F%3ENikhil%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,
We are doing site provisioning through site script where where power automate is being called for creating Azure storage queque and invoking pnp provisiong command throught Azure pnp powershell.

 

Invoke-PnPSiteTemplate -Path "C:\templateCustom.xml" -ResourceFolder "C:\"

 

Since this set up is for one language template DE then we are able to manage locale and regional setting by explicitely calling this action in SiteScript:

 

{
"verb": "setRegionalSettings",
"timeZone": 4,
"locale": 1031,
"sortOrder": 25,
"hourFormat": "24"
}

 

Now we want to extend this for multiple language and for that we have created separate pnp template for EN and RO and calling invoke pnp command by checking language ID on PnP powershell like this:

 

if($languageID -eq 1031)
{
Write-Output "Connected to DE site"
Invoke-PnPSiteTemplate -Path "D:\TemplateDE.xml" -ResourceFolder "D:\"
}
elseif($languageID -eq 1033)
{
Write-Output "Connected to EN site"
Invoke-PnPSiteTemplate -Path "D:\TemplateEN.xml" -ResourceFolder "D:\"
}
elseif($languageID -eq 1048)
{
Write-Output "Connected to RO site"
Invoke-PnPSiteTemplate -Path "D:\TemplateRO.xml" -ResourceFolder "D:\"
}

 

Now problem here is that i can not keep above regional settings in site script otherwise it will always set same regional settings here.

 

If i am removing setregionalsettings action from site script then also default regional setting of UTC 8:00 with locale DE is getting set.

 

When we apply the template using the below command directly without using site script from PnP powershell regional settings are applied according to source template

 

 

 

Connect-PnPOnline -URL "BaseTemplateSiteURL"
Get-PnPSiteTemplate -Out "D:\templateCustom.xml" -Handlers "Lists" -ExcludeHandlers "SiteSecurity,TermGroups,Fields,ContentTypes,Navigation" -PersistBrandingFiles -IncludeAllPages -Force

 


Connect-PnPOnline -URL "CustomTemplateAppliedSiteURL"
Invoke-PnPSiteTemplate -Path "C:\templateCustom.xml" -ResourceFolder "C:\"

 


but, when we are applying the template using the siteScript, the default regional settings for the selected language not applied.

Thanks,
Nikhil

0 Replies