SharePoint Set Locale Region on All Web Applications and Site Collections

A quick script works on both SharePoint 2010 and 2013. Make sure to update en-AU to the target locale you are after =).

Enjoy!

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | ? -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs)
{
$NewLocale = "en-AU"
foreach ($webApp in $websvc.WebApplications)
{
foreach ($site in $webApp.Sites)
{
Write-Host "Updating Site -" $site -ForegroundColor "Green"
     
$Webs = $site.AllWebs
ForEach ($Web In $Webs)
{
   If ($Web.locale -ne $NewLocale)
   {
      Write-Host $Web.title "- " -NoNewLine; Write-Host "changing from" $Web.locale "to" $NewLocale -ForegroundColor "Green"
      $Web.Locale = $NewLocale
      $Web.Update()
      $Web.Dispose()
   }
   Else { Write-Host $Web.title "- " -NoNewLine; Write-Host "already set to" $NewLocale -ForegroundColor "Blue"
   }
}
}
}
}

Comments

  1. Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions.
    web hosting in Nigeria

    ReplyDelete
  2. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
    internet marketing services pricing

    ReplyDelete
  3. The report is assembled with the determination of providing necessary market information to retailers operating in the global market.siteground vs bluehost

    ReplyDelete

Post a Comment

Popular posts from this blog

WinDBG on 32Bit Applications

EXCEL Macro - Compare Column A to Column B

Powershell Script to Automatically Deploy Sharepoint WSP Packages