{"id":6467,"date":"2021-03-16T06:56:51","date_gmt":"2021-03-16T06:56:51","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6467"},"modified":"2021-03-16T06:56:51","modified_gmt":"2021-03-16T06:56:51","slug":"change-regional-setting-using-pnp-powershell","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/","title":{"rendered":"Change Regional setting using PnP PowerShell"},"content":{"rendered":"\n<p><strong><u>Introduction<\/u><\/strong><\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Changing Regional settings of a SharePoint Online site manually is straight forward but if someone needs to change the regional settings for all the sites then it will be a time-consuming procedure.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So here I have tried to make the task a bit easier. I have made a PowerShell script to change the regional setting in the site.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Here, I have used PnP online to perform this action. We have to follow the below steps to write the script.<\/p>\n\n\n\n<p><strong>Step-1: &#8211; <\/strong>Run ISE in administrative mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San1.png\" alt=\"\" class=\"wp-image-6468\"\/><\/figure>\n\n\n\n<p><strong>Step-2: &#8211; <\/strong>Declare two variables named \u201c<strong>SiteURL<\/strong>\u201d and \u201c<strong>Timezone<\/strong>\u201d and store the values of the site Url and the time zone which you want to set for your site.<\/p>\n\n\n\n<p><strong>Step-3: &#8211;<\/strong> Connect PnP online and get the credentials by using the below command.<\/p>\n\n\n\n<p>Connect-PnPOnline -Url $siteURL -Credentials (Get-Credential)<\/p>\n\n\n\n<p><strong>Step-4: &#8211; <\/strong>Get the web including the region setting and then get the time zone by using the PnP commands as shown in the code.<\/p>\n\n\n\n<p><strong>Step-5: &#8211; <\/strong>Copy and run the below codes to set\/change the regional setting.<\/p>\n\n\n\n<p>#Set the required Variables<\/p>\n\n\n\n<p>$SiteURL = &#8220;https:\/\/contoso.sharepoint.com&#8221;<\/p>\n\n\n\n<p>$Timezone = &#8220;(UTC-08:00) Pacific Time (US and Canada)&#8221;<\/p>\n\n\n\n<p>#Connect to SharePoint Online with PnP PowerShell<\/p>\n\n\n\n<p>Connect-PnPOnline -Url $siteURL -Credentials (Get-Credential)<\/p>\n\n\n\n<p>#Get the Web<\/p>\n\n\n\n<p>$web = Get-PnPWeb -Includes RegionalSettings.TimeZones<\/p>\n\n\n\n<p>#Get the time zone<\/p>\n\n\n\n<p>$Tzone&nbsp; = $Web.RegionalSettings.TimeZones | Where {$_.Description -eq $Timezone}<\/p>\n\n\n\n<p>If($Timezone -ne $Null)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.LocaleId = 1036 # French<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.WorkDayStartHour = 9<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.WorkDayEndHour = 6<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.FirstDayOfWeek = 0 # Sunday<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.Time24 = $False<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.CalendarType = 1 #Gregorian<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.AlternateCalendarType = 0 #None<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.RegionalSettings.WorkDays = 124<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; $Web.Update()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Invoke-PnPQuery<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Write-host &#8220;Timezone is Successfully Updated &#8221; -ForegroundColor Green<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>else<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Write-host &#8220;Can&#8217;t Find Timezone $TimezoneName &#8221; -ForegroundColor Red<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>After running the above code, we can check the regional setting of the provided site is changed successfully.<\/p>\n\n\n\n<p><strong>Before running the script:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San2.png\" alt=\"\" class=\"wp-image-6469\"\/><\/figure>\n\n\n\n<p><strong>After running the script:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/san3.png\" alt=\"\" class=\"wp-image-6470\"\/><\/figure>\n\n\n\n<p>I hope the given piece of code is helpful to change the regional setting without giving too much of effort by changing it manually.<\/p>\n\n\n\n<p><strong>Key words:<\/strong><\/p>\n\n\n\n<p>1.How to change Regional setting using PowerShell.<br>2.Change the time zone and region settings using PowerShell.<br>3.Use PowerShell to change the regional setting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Changing Regional settings of a SharePoint Online site manually is straight forward but if someone needs to change the regional settings for all the sites then it will be a time-consuming procedure. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So here I have tried to make the task a bit easier. I have made a PowerShell script to change the regional setting in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[298],"tags":[],"class_list":["post-6467","post","type-post","status-publish","format-standard","hentry","category-pnp-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change Regional setting using PnP PowerShell - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Regional setting using PnP PowerShell - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"Introduction &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Changing Regional settings of a SharePoint Online site manually is straight forward but if someone needs to change the regional settings for all the sites then it will be a time-consuming procedure. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So here I have tried to make the task a bit easier. I have made a PowerShell script to change the regional setting in the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-16T06:56:51+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change Regional setting using PnP PowerShell - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Change Regional setting using PnP PowerShell - Softree Technology","og_description":"Introduction &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Changing Regional settings of a SharePoint Online site manually is straight forward but if someone needs to change the regional settings for all the sites then it will be a time-consuming procedure. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So here I have tried to make the task a bit easier. I have made a PowerShell script to change the regional setting in the [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/","og_site_name":"Softree Technology","article_published_time":"2021-03-16T06:56:51+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Change Regional setting using PnP PowerShell","datePublished":"2021-03-16T06:56:51+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/"},"wordCount":430,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San1.png","articleSection":["PnP PowerShell"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/","url":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/","name":"Change Regional setting using PnP PowerShell - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San1.png","datePublished":"2021-03-16T06:56:51+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#primaryimage","url":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San1.png","contentUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/03\/San1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/change-regional-setting-using-pnp-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Change Regional setting using PnP PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=6467"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6467\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}