{"id":736,"date":"2018-10-30T06:18:39","date_gmt":"2018-10-30T06:18:39","guid":{"rendered":"http:\/\/blog.softreeconsulting.com\/?p=736"},"modified":"2018-10-30T06:18:39","modified_gmt":"2018-10-30T06:18:39","slug":"change-user-regional-setting-always-follow-web-using-powershell","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/","title":{"rendered":"Change User Regional Setting to \u201cAlways follow Web\u201d using PowerShell"},"content":{"rendered":"<p><a href=\"http:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-737\" src=\"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png\" alt=\"powershell\" width=\"799\" height=\"457\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">I have written this PowerShell script which is related to user regional setting. This below-mentioned code block will help us to change user regional setting to \u201calways follow web\u201d regional setting.<\/p>\n<p>[code lang=&#8221;c&#8221;]<\/p>\n<p>Write-Host -ForegroundColor cyan &#8216;Please provide the site url&#8217;<br \/>\n$SiteURL = Read-Host &#8220;Site Url&#8221;<\/p>\n<p>try<br \/>\n{<br \/>\nAdd-PSSnapin &#8220;Microsoft.SharePoint.PowerShell&#8221;<br \/>\n$SPsiteURL = Get-SPSite $SiteURL<br \/>\n$SPserviceContext = Get-SPServiceContext $SPsiteURL<br \/>\n$SPweb = $SPsiteURL.openweb()<br \/>\n$SPusers = $SPweb.SiteUsers<\/p>\n<p>Foreach($SPUser in $SPusers)<br \/>\n{<br \/>\ntry<br \/>\n{<br \/>\n$UserLoginName = $SPuser.LoginName<br \/>\n$UserDisplayName = $SPuser.DisplayName<\/p>\n<p>$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($SPserviceContext)<\/p>\n<p>if ($profileManager.UserExists($UserLoginName))<br \/>\n{<br \/>\n$userProfile = $profileManager.GetUserProfile($UserLoginName)<br \/>\n$regSettng = $userProfile[&#8216;SPS-RegionalSettings-FollowWeb&#8217;]<br \/>\n$regSettng.Value = $true<br \/>\n$userProfile.Commit()<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nwrite-host &#8220;User Profile for user&#8221; $UserDisplayName &#8220;cannot be found.&#8221;<br \/>\n}<br \/>\n}<br \/>\ncatch<br \/>\n{<br \/>\n$ErrorMessage = $_.Exception.Message<br \/>\nwrite-host $ErrorMessage<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\nCatch<br \/>\n{<br \/>\n$ErrorMessage = $_.Exception.Message<br \/>\nwrite-host $ErrorMessage<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p><strong>This solution is brought to you by our SharePoint professionals.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/www.softreeconsulting.com\/\"><strong>Softree Consulting<\/strong><\/a>\u00a0employs SharePoint consultants; we are a technology services provider with the aim to help companies achieve exceptional performance through SharePoint. Our dedicated team of SharePoint consultants has the right bent of mind to understand and execute customer requirements.<\/p>\n<p style=\"text-align: justify;\">Be it SPFx or SharePoint add-in developments,\u00a0<strong>SharePoint 2019 developments<\/strong>, web part developments, migrating from SharePoint 2010\/2013 to SharePoint 2013\/2016\/Office 365, Office 365,\u00a0<a href=\"http:\/\/www.softreeconsulting.com\/sharepoint-azure-ad\/\">SharePoint hosted apps development<\/a>\u00a0or something else in SharePoint, we strive to deliver the best<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have written this PowerShell script which is related to user regional setting. This below-mentioned code block will help us to change user regional setting to \u201calways follow web\u201d regional setting. [code lang=&#8221;c&#8221;] Write-Host -ForegroundColor cyan &#8216;Please provide the site url&#8217; $SiteURL = Read-Host &#8220;Site Url&#8221; try { Add-PSSnapin &#8220;Microsoft.SharePoint.PowerShell&#8221; $SPsiteURL = Get-SPSite $SiteURL $SPserviceContext = Get-SPServiceContext $SPsiteURL $SPweb = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[173,174,175],"class_list":["post-736","post","type-post","status-publish","format-standard","hentry","category-all","tag-how-to-use-powershell","tag-powershell-examples","tag-powershell-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change User Regional Setting to \u201cAlways follow Web\u201d using 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\/all\/change-user-regional-setting-always-follow-web-using-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change User Regional Setting to \u201cAlways follow Web\u201d using PowerShell - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"I have written this PowerShell script which is related to user regional setting. This below-mentioned code block will help us to change user regional setting to \u201calways follow web\u201d regional setting. [code lang=&#8221;c&#8221;] Write-Host -ForegroundColor cyan &#8216;Please provide the site url&#8217; $SiteURL = Read-Host &#8220;Site Url&#8221; try { Add-PSSnapin &#8220;Microsoft.SharePoint.PowerShell&#8221; $SPsiteURL = Get-SPSite $SiteURL $SPserviceContext = Get-SPServiceContext $SPsiteURL $SPweb = [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-30T06:18:39+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=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change User Regional Setting to \u201cAlways follow Web\u201d using 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\/all\/change-user-regional-setting-always-follow-web-using-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Change User Regional Setting to \u201cAlways follow Web\u201d using PowerShell - Softree Technology","og_description":"I have written this PowerShell script which is related to user regional setting. This below-mentioned code block will help us to change user regional setting to \u201calways follow web\u201d regional setting. [code lang=&#8221;c&#8221;] Write-Host -ForegroundColor cyan &#8216;Please provide the site url&#8217; $SiteURL = Read-Host &#8220;Site Url&#8221; try { Add-PSSnapin &#8220;Microsoft.SharePoint.PowerShell&#8221; $SPsiteURL = Get-SPSite $SiteURL $SPserviceContext = Get-SPServiceContext $SPsiteURL $SPweb = [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/","og_site_name":"Softree Technology","article_published_time":"2018-10-30T06:18:39+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Change User Regional Setting to \u201cAlways follow Web\u201d using PowerShell","datePublished":"2018-10-30T06:18:39+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/"},"wordCount":215,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png","keywords":["how to use powershell","powershell examples","powershell tutorial"],"articleSection":["All"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/","url":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/","name":"Change User Regional Setting to \u201cAlways follow Web\u201d using PowerShell - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png","datePublished":"2018-10-30T06:18:39+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#primaryimage","url":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png","contentUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2018\/10\/PowerShell.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/all\/change-user-regional-setting-always-follow-web-using-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Change User Regional Setting to \u201cAlways follow Web\u201d using 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\/736","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=736"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/736\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}